【问题标题】:How to fix each column in Table? [closed]如何修复表格中的每一列? [关闭]
【发布时间】:2019-08-25 21:30:38
【问题描述】:
我尝试在下面的图片中阅读 Wordpress 中的源代码。
我不知道他们如何修复每一列 HTML/CSS,不知道他们使用什么。
当您转到其他页面时,列仍然在同一位置。
但是当我在 CodeIgniter 中通过转到其他页面来尝试分页/表格库时,表格是灵活的,并且依赖于单元格中的信息。
图片在这里:
【问题讨论】:
标签:
html
css
wordpress
html-table
【解决方案1】:
你可以使用带宽度的 div
<table>
<tr>
<td><div style="width: 200px;">
test...
</div></td>
<td><div style="width: 600px;">
test...
</div></td>
</tr>
</table>
【解决方案2】:
width 属性在 CSS 中指定:
.fixed .column-response,
.fixed .column-author,
.fixed .column-categories,
.fixed .column-tags,
.fixed .column-rel,
.fixed .column-role {
width: 15%;
}
同样,table 元素是固定宽度的:
table.fixed {
table-layout: fixed;
}