这里我有一个问题,就是我需要列表框中的列表项应该有间距。但我运气不好,我无法做到。这可能与否。任何人都可以帮助我。我已经谷歌了,但我找不到具体的解决方案。
代码:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Sistema instanciaSys = Sistema.darInstancia();
instanciaSys.inicializarSistema(6);
Esquina[] esquinas = instanciaSys.getEsquinas();
JSONArray json =new JSONArray();
for (Esquina esquina : esquinas) {
JSONObject jO = new JSONObject();
jO.put("coordX", esquina.getCoordX());
jO.put("coordY", esquina.getCoordY());
json.put(jO);
}
// tell the client that JSON is coming
response.setContentType("application/json");
resposne.setCharacterEncoding("UTF-8");
json.write(response.getWriter());
}
此致
Thanes
答案 0 :(得分:-1)
由于列表项呈现为html选项,您可以添加一些CSS。
<head runat="server">
<title>My Page Title</title>
<style>
option {
padding-bottom: 15px;
padding-top: 15px;
}
</style>
如果要将其应用于特定列表框,可以执行以下操作:
<style>
#ListBox1 option {
padding-bottom: 15px;
padding-top: 15px;
}
</style>