2012-02-20 98 views
0

我想提出一个固定的高度和宽度在我的细胞:固定的高度和宽度上的TD细胞 - HTML

的表格变得更大,如果有在$ 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},&nbsp;">${elem}<c:if test="${!cellStatus.last}">,&nbsp;</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

因此,只要通过应用定义了一个固定的高度+宽度相应的CSS属性。换句话说 - 你的问题是什么? – home 2012-02-20 18:04:07

回答

3
.data_table {table-layout: fixed; } 
0

尝试增加 “表格的布局:固定” 作为表的CSS的一部分。也许这会解决你的问题。

0

也许你有问题,你的高度,因为你没有正确定义它:

<td class="narrow" style="width:75px;height:75;"> 

把这样的PX:

<td class="narrow" style="width:75px;height:75px;">