4列のテーブルがあります。最初の 1 つは 5% 固定、次の 3 つは 20% 固定にしたいです。したがって、最後の 3 つが常に同じ幅であることを確認するために、使用してtable-layout:fixed
いる . ただし、これにより、最初の td が最後の 3 列と同じ幅になります。
ここに私のHTMLがあります:
<tr>
<td class="groupsOptionsCheckboxCell"><input type="checkbox"/></td>
<td>{{COMPONENT_NAME}}</td>
<td>{{CO}}</td>
<td>{{PANEL_OPTIONS}}</td>
</tr>
そして私のCSS:
.creatorOptionsTable {border-collapse: collapse; width: 80%; table-layout: fixed;}
.creatorOptionsTable tr {border-bottom: 1px solid black;}
.creatorOptionsTable td {padding: 5px 3%; width: 20%; border-left: 1px solid black; word-wrap: break-word}
.creatorOptionsTable td.groupsOptionsCheckboxCell, .creatorOptionsTable th.groupsOptionsCheckboxCell {width: 5% !important; text-align: center; border-left: none;}
注意してください、私は<table>
これにタグを含めていないことを認識しています. しかし、それはそこにあります。
これは簡単なはずですが、うまくいきません。
ここに私のコード全体があります:
<table id="creatorOptionsAddTable" class="creatorOptionsTable">
<tr class="firstRow">
<th clas="groupsOptionsCheckboxCell"></th>
<th>Component</th>
<th>Description</th>
<th>Panel</th>
</tr>
<tr>
<td class="groupsOptionsCheckboxCell"><input type="checkbox"/></td>
<td>{{COMPONENT_NAME}}</td>
<td>{{COMPONET_DESCRIPTION}}</td>
<td>{{PANEL_OPTIONS}}</td>
</tr>
</table>