gpt4 book ai didi

html - 单元格边框更改会影响整个表格标记

转载 作者:行者123 更新时间:2023-11-28 13:57:47 25 4
gpt4 key购买 nike

我有下一个样式的表:

table {
border-collapse:collapse;
}

td, th {
height: 20px;
width: 20px;
border: 1px solid #000000;
text-align:center;
}

th {
border: 0;
}

当我更改一个或几个单元格的边框宽度、行和列的宽度以及整个表格宽度以未定义的方式更改时。它不是那么严重,我想完全防止任何视觉变化,除了受影响单元格的边界。更改这些单元格的宽度或高度没有帮助。如何防止修改表格位置并仅更改所需单元格的边框宽度?

JSFiddle


UPD 问题已修复。我只是在表格的右侧和底部添加了两行和两列,并将最后一行和最后一列的边框设置为 2px。

最佳答案

border-collapse:collapse 意味着您所有的单元格边框都混合在一起,因此也采用相同的样式。

See this link

collapse - in which both the space and the borders between table cells collapse so there is only one border and no space between cells.

关于html - 单元格边框更改会影响整个表格标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10663911/

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