2012-02-20 16 views
0

私は私の細胞に固定された高さと幅を入れたい:$のelemは上の長い列がある場合、テーブルが大きく取得は、TD細胞上の高さと幅を修正 - HTML

<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:テーブルの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

答えて

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

してみてください。多分、これはあなたの問題を解決するでしょう。

0

あなたはそれを正しく定義しないので、たぶん、あなたはあなたの高さに問題がある:

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

はそのようなピクセルを置く:

<td class="narrow" style="width:75px;height:75px;"> 
関連する問題