table-layout:修复问题

San*_*ndy 3 css tablelayout

我有一个table固定的表格布局.表中有2列.

如果我colspan=2为第一行设置,那么对于剩余的行,它显示相等的宽度.(它没有采用我指定的宽度.)

小提琴附在这里

<table style='table-layout:fixed' border="1" width="100%">
  <thead>
    <tr>
      <th colspan='2'>10000</th>
    </tr>
    <tr>
      <th width="5%">1066fdg</th>
      <th width="95%">10</th>
    </tr>
  </thead>
</table>
Run Code Online (Sandbox Code Playgroud)

无论如何为剩余的行设置指定的列宽?

Ser*_*geS 6

这是因为固定表布局由第一行OR列定义驱动 - 试试这个

<table style='table-layout:fixed' border="1" width="100%">
<col width="5%" />
<col width="95%" />
<thead>
<tr>
<th colspan='2'>10000</th>
</tr>
<tr>
<th>1066fdg</th>
<th>10</th>
</tr>
</thead>
</table>
Run Code Online (Sandbox Code Playgroud)