html - 如何为 Chrome 中的表格单元格添加透明边框?

标签 html css google-chrome

我的 last question在我得到完整答案之前已经关闭,所以我将以不同的方式分阶段进行。

在 Chrome 中,如果您在一个表格单元格上设置边框底部,您必须在同一行中的所有单元格上设置边框底部,否则 Chrome 不知道如何处理未计算的空间.

It was suggested我只是使用白色边框使其看起来好像其他单元格没有边框。但是,如果我有一个渐变背景,并且不想出现白线怎么办?

看来 1px solid transparent没有任何影响。 rgba也不起作用。

最佳答案

根据 MDN这一切都归结为 border-collapse 属性:

The separated model is the traditional HTML table border model. Adjacent cells each have their own distinct borders. The distance between them given by the border-spacing property.

In the collapsed border model, adjacent table cells share borders. In that model, the border-style value of inset behaves like groove, and outset behaves like ridge.

border-collapse 更改为 separate,效果很好: jsFiddle example

关于html - 如何为 Chrome 中的表格单元格添加透明边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16245110/

相关文章:

jquery - 如何使用 jQuery 将 <div> 置于另一个元素的底部中心?

javascript - 如何安全地将 HTML 和其他符号转换/解析为简单文本?

javascript - 如果在移动设备上,将数组(索引列表)拆分为两行

javascript - Chrome 扩展 - popup.html 中的按钮

javascript - 从 Chrome 扩展程序连接到数据库?

java - 使用 Jsoup 获取所有 Html5 标签?

javascript - 将字符串从一个 div 动态更新到另一个

javascript - 向下滚动按钮不起作用

html - 如何构建 HTML 页面的布局?

java - 有什么方法可以阻止浏览器每秒请求相同的图像?