我想在我的细胞上放置一个固定的高度和宽度:
如果$ elem上有一个长数组
,表格会变大 <table align="center" class="data_table vert_scroll_table" >
<tr>
<c:forEach var="heading" items="${results.headings}">
<th class="narrow">${heading}</th>
</c:forEach>
</tr>
<c:forEach var="row" items="${results.data}">
<tr>
<c:forEach var="cell" items="${row}" varStatus="rowStatus">
<td class="narrow" style="width:75px;height:75;">
<c:choose>
<c:when test="${results.types[rowStatus.index].array}">
<c:forEach var="elem" items="${cell}" varStatus="cellStatus">
<span class="mouseover_text" title="${elem}, ">${elem}<c:if test="${!cellStatus.last}">, </c:if></span>
</c:forEach>
</c:when>
<c:otherwise>
${cell}
</c:otherwise>
</c:choose>
</td>
</c:forEach>
</tr>
</c:forEach>
</table>
的CSS:
table.data_table
{
border: 2px gray solid;
}
table.data_table td,
table.data_table th,
table.data_table th.header2
{
font-size: 7.5pt;
white-space: normal;
padding-left: 4px;
padding-right: 4px;
}
答案 0 :(得分:3)
.data_table {table-layout: fixed; }
答案 1 :(得分:0)
尝试添加“table-layout:fixed”作为表格CSS的一部分。也许这会解决你的问题。
答案 2 :(得分:0)
也许你的身高有问题,因为你没有正确定义它:
<td class="narrow" style="width:75px;height:75;">
像这样放px:
<td class="narrow" style="width:75px;height:75px;">