layui静态表格固定列宽

在table的样式中加入table-layout: fixed,并且留下一列不设置宽度,让其自适应宽度

<table id="table" style="table-layout: fixed" class="layui-table">
<colgroup>
<col>
<col width="200">
<col width="80">
<col width="200">
</colgroup>
<thead>
<tr>
<th>名称</th>
<th>编码</th>
<th>数量</th>
<th>备注</th>
</tr>
</thead>
<tbody id="tbody" class="tbody">
</tbody>

</table>

posted @ 2022-10-27 10:56  奇迹之耀  阅读(784)  评论(0编辑  收藏  举报