gpt4 book ai didi

css - 如何修复宽度不固定的表格的标题?

转载 作者:行者123 更新时间:2023-11-28 15:57:09 26 4
gpt4 key购买 nike

我有一个用户可以添加新列的表。因此宽度不固定。如何修复此类表格的标题?

我试过:

display:block
overflow-x:hidden
overflow-y:auto
height:70%

在表体中。它部分起作用。

最佳答案

如果我正确理解您的问题(发布您的 HTML 会有所帮助),您可以在可扩展的部分内嵌套一个表格。您将能够添加尽可能多的列 ( <td>) 而不会影响表格标题。

table td table td {
border: solid 1px grey;
}
<table>
<tr>
<th>Add your fixed table header</th>
</tr>
<tr>
<td>
<table>
<tr>
<td>New Columns</td>
<td>can be added</td>
<td>without effecting your header</td>
</tr>
</table>
</td>
</tr>
</table>

关于css - 如何修复宽度不固定的表格的标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40908222/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com