gpt4 book ai didi

css - 表格单元格宽度统一

转载 作者:太空宇宙 更新时间:2023-11-04 02:15:58 24 4
gpt4 key购买 nike

我继续开发和探索 CSS。我想将所有表格单元格都设置为相同的宽度,而不是像它在 jsfiddle 中的显示方式。我尝试手动将宽度添加到“th 标签”和“td 标签”,但它们没有给出我定义的宽度。

.tablesorter {
margin: -5px 0 0 0;
table-layout: fixed;
}

.tablesorter td{
margin: 0;
padding: 0;
border-bottom: 1px dotted #ccc;
}

.tablesorter thead tr {
height: 34px;
color:#082B33;;
background:#B5E5EF;
text-align: left;
cursor: pointer;
}

fiddle 链接如下: https://jsfiddle.net/4j43fdm1

最佳答案

试试这个

  .tablesorter{
width:100%;
}

table tr th, table tr td{
width:16.6%;
word-break: break-all;
}

Click here for demo

关于css - 表格单元格宽度统一,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38915217/

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