我做的一个课程表 private String stuId; private String stuPass; private String stuName; private String stuGender; private String academy; private String stuClass; private ArrayList<Course> courses; 课程属性: private String courseId;
private float coursePoint;
private String courseName;
private String academy;
private String index;
private String courseTea;
private String courseRoom;
页面显示: |
|
一排一排的输出到对应的位置就行了,哪这么麻烦。
|
|
怎么一排一排输出,不是每个位置都有数据 |
|
不懂啊- -。。 |
|
这还不简单 就像分奇偶数显示一样 用js细吧 这样逻辑代码好写
|
|
求大神写个代码看看,只说思路,小白我转不过弯啊
|
|
50分 |
你如果连一楼的代码都看不懂······那真的不是我们三两句能给你解释的清的了····随手给你贴一段很早的一个页面的布局,你看下你能看懂多少吧 从一页中间截的 肯定有找不到的变量 大概看下是那么个意思 你借鉴一下
<table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″> <tr> <td width=”8″ background=”<%=basePath %>images/tab_12.gif”> </td> <td><table width=”100%” border=”0″ cellpadding=”0″ cellspacing=”1″ bgcolor=”b5d6e6″ onmouseover=”changeto()” onmouseout=”changeback()”> <tr> <!– <td width=”3%” height=”22″ background=”<%=basePath %>images/bg.gif” bgcolor=”#FFFFFF”><div align=”center”> <input type=”checkbox” name=”checkall” onclick=”checkAll();” /> </div></td> –> <td width=”3%” height=”22″ background=”<%=basePath %>images/bg.gif” bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″>序号</span></div></td> <td width=”10%” height=”22″ background=”<%=basePath %>images/bg.gif” bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″>条形码</span></div></td> <td width=”10%” height=”22″ background=”<%=basePath %>images/bg.gif” bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″>设备名称</span></div></td> <td width=”15%” height=”22″ background=”<%=basePath %>images/bg.gif” bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″>设备类别</span></div></td> <td width=”10%” height=”22″ background=”<%=basePath %>images/bg.gif” bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″>品牌</span></div></td> <td width=”10%” height=”22″ background=”<%=basePath %>images/bg.gif” bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″>型号</span></div></td> <td width=”10%” height=”22″ background=”<%=basePath %>images/bg.gif” bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″>颜色</span></div></td> <td width=”10%” height=”22″ background=”<%=basePath %>images/bg.gif” bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″>容量</span></div></td> <td width=”10%” height=”22″ background=”<%=basePath %>images/bg.gif” bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″>固定资产编号</span></div></td> <td width=”10%” height=”22″ background=”<%=basePath %>images/bg.gif” bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″>设备状态</span></div></td> <td width=”10%” height=”22″ background=”<%=basePath %>images/bg.gif” bgcolor=”#FFFFFF” class=”STYLE1″><div align=”center”>基本操作</div></td> </tr> <% /*计算起始序号*/ int startIndex = (currentPage -1) * 3; /*遍历记录*/ for(int i=0;i<deviceList.size();i++) { int currentIndex = startIndex + i + 1; //当前记录的序号 device device = deviceList.get(i); //获取到设备对象 %> <tr> <td height=”20″ bgcolor=”#FFFFFF”><div align=”center” class=”STYLE1″> <div align=”center”><%=currentIndex %></div> </div></td> <td height=”20″ bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″><%=device.getCode() %></span></div></td> <td height=”20″ bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″><%=device.getName() %> </span></div></td> <%int id=Integer.parseInt(device.getType().toString()); devicetypedao dvtdao=new devicetypedao(); devicetype dt= dvtdao.GetDeviceTypeById(id); %> <td bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″><%=dt.getDevicetypename() %></span></div></td> <td height=”20″ bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″><%=device.getBrand() %></span></div></td> <td height=”20″ bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″><%=device.getModel() %></span></div></td> <td height=”20″ bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″><%=device.getColor() %></span></div></td> <td height=”20″ bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″><%=device.getCapacity() %></span></div></td> <td height=”20″ bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″><%=device.getPropertynumber() %></span></div></td> <td height=”20″ bgcolor=”#FFFFFF”><div align=”center”><span class=”STYLE1″><%=device.getStatus() %></span></div></td> <td height=”20″ bgcolor=”#FFFFFF”><div align=”center”> <span class=”STYLE4″> <span style=”cursor:pointer” onclick=”location.href=””<%=basePath %>/device/devicemodifyquery.action?code=<%=device.getCode() %>”””><img src=”<%=basePath %>images/edt.gif” width=”16″ height=”16″/>编辑 </span> <img src=”<%=basePath %>images/del.gif” style=”cursor:pointer” width=”16″ height=”16″/><a href=”<%=basePath %>/device/devicedelete.action?code=<%=device.getCode() %>” onclick=”return confirm(“”确定删除本设备吗?””);”>删除</a></span> </div></td> </tr> <% } %> </table></td> <td width=”8″ background=”images/tab_15.gif”> </td> </tr> </table> 效果是 |