0

我有一张用table-layout:fixed. 表格中有六列,我分别设置每列的宽度。对于某些列,其中的文本被截断。有没有办法根据内容设置特定列(一列或两列)的宽度?

4

1 回答 1

0

使用列组并使用以下语法将指定列的宽度设置为由内容确定的最小所需值:

<table>
  <colgroup>
    <col width="30"><!--fixed width column-->
    <col width="0*"><!--minimum width of content column-->
  </colgroup>
  <tr>
    <td>
    <!--...-->
    </td>
  </tr>
</table>
于 2012-09-11T03:04:11.253 回答