我最初硬编码了我的细胞宽度和高度。但我们反对这一点。现在我希望它按原样运行,缩小和扩展,但一旦达到一定的宽度就停止。
<table align="center" class="data_extract vert_scroll_table" >
<tr>
<c:forEach var="heading" items="${results.headings}">
<th class="data_extract">${heading}</th>
</c:forEach>
</tr>
<c:forEach var="row" items="${results.data}">
<tr>
<c:forEach var="cell" items="${row}" varStatus="rowStatus">
<td class="data_extract">
<c:choose>
<c:when test="${results.types[rowStatus.index].array}">
<c:set var="comma" value="," />
<c:forEach var="elem" items="${cell}" varStatus="cellStatus">
<c:set var="myVar" value="${cellStatus.first ? '' : myVar} ${elem} ${cellStatus.last ? '' : comma}" />
</c:forEach>
<span class="mouseover_text" title="${myVar}">${myVar}</span>
</c:when>
<c:otherwise>
${cell}
</c:otherwise>
</c:choose>
</td>
</c:forEach>
</tr>
</c:forEach>
</table>
的CSS:
table.data_extract
{
border: 2px gray solid;
border-collapse: collapse;
}
td.data_extract,
th.data_extract,
table.data_extract td,
table.data_extract th
{
text-align: center;
font-size: 7.5pt;
white-space: normal;
}
答案 0 :(得分:0)
您可以使用CSS min-width和min-height属性
答案 1 :(得分:0)
将max-width: {whatever width you want}
和min-width: {whatever width you want}
添加到您的td.data_extract规则中。