簡體   English   中英

使內表高度為父 td 的 100%

[英]Making inner table height 100% to parent td

我需要將內表高度設為父 td 的 100% 高度。 因為我使用了一些具有復雜數據結構的角度 ng-repeat。 我沒有更改 html 結構的選項。

請幫助我解決如何將內表設置為父 td 的 100% 高度的解決方案。 我嘗試了很多選擇,但沒有奏效。

 .parent { border: 1px solid #000; border-collapse: collapse; } .parent td, .parent tr, .parent th { border: 1px solid #000; } .inner { height: 100%; }
 <table class='parent'> <tr> <th>head</th> <th>head</th> <th>Description</th> <th> <table> <tr> <th>head</th> <th>head</th> <th>head</th> <th>head</th> </tr> </table> </th> </tr> <tr> <td>values</td> <td>values</td> <td>Description goes here, Description goes here, Description goes here, Description goes here, Description goes here, Description goes here, Description goes here, Description goes here, Description goes here, Description goes here, Description goes here, Description goes here, Description goes here, Description goes here, Description goes here, Description goes here, Description goes here,</td> <td> <table class='inner'> <tbody> <tr> <td>H1 Val</td> <td>H2 Val</td> <td>H3 Val</td> <td>H4 Val</td> </tr> </tbody> </table> </td> </tr> </table>

將 .parent 的高度也設置為 100%,就是這樣。

所以;

    .parent{
      border:1px solid #000;
      border-collapse:collapse;
      height: 100%;
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM