使用内容调整表头的大小

问题描述 投票:0回答:1

我有一个表格,里面有内容。我希望能够将列的大小调整为0像素,以使其看起来“消失”。问题在于,由于标题和单元格中有内容,因此它将仅调整为内容的大小。

我只是希望它像这样工作:我通过将单元格内容包装到绝对定位的容器中来进行变通:

<table> <tr> <th style="width:0px"> <div class="cell-wrapper">Some super long content</div> </th> <th> <div class="cell-wrapper">More content, could be an image</div> </th> </tr> </table> .cell-wrapper { position: absolute; }

但是这种方法存在多个问题。没有绝对的定位/容器解决方法,有没有办法做到这一点?谢谢!

我有一个表格,里面有内容。我希望能够将列的大小调整为0像素,以使其看起来“消失”。问题在于,由于标题和单元格中有内容,因此它是...

html css
1个回答
0
投票
您可以尝试这样的事情。

© www.soinside.com 2019 - 2024. All rights reserved.