目前我正在做一个项目,我需要在数据库的列中显示信息,但由于某种原因它们显示在一行中。现在显示如下:
我还附上了我的 jsp 页面中的代码:
<table border="1"
cellspacing="0" cellpadding="3"
style="font-size: small; line-height: 100px; border-color: #D1EEEE">
<tr bgcolor="#DCDCDC" align="left" style="border-color: #838B83">
<th width="250px">Discipline</th>
<th width="100px">Mark</th>
</tr>
<c:forEach items="${Disc}" var="Dis">
<td style="padding-bottom: 20px">${Dis.discipline}</td>
<td style="padding-bottom: 20px">0</td>
</c:forEach>
<td/>
</table>
这是如何引起的以及如何解决?
我设法找到了一个解决方案——这是显而易见的。有必要: 添加<tr>
and </tr>
到循环。去除晦涩难懂的东西<td/>
.
<table>
<tr>
<td style="padding: 50px 0 0 0">
<table border="1"
cellspacing="0" cellpadding="3"
style="font-size: small; line-height: 100px; border-color: #D1EEEE">
<tr bgcolor="#DCDCDC" align="left" style="border-color: #838B83">
<th width="250px">Discipline</th>
<th width="100px">Mark</th>
</tr>
<c:forEach items="${Disc}" var="Dis">
<tr>
<td style="padding-bottom: 20px">${Dis.discipline}</td>
<td style="padding-bottom: 20px">0</td>
</tr>
</c:forEach>
</table>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)