2012-02-20 102 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;">