HTML – 边框崩溃不再工作

HTML – 边框崩溃不再工作,第1张

概述对不起,我知道之前已经提出了类似的问题,但是我的案例中没有提到任何建议.我有一个表(对于表格数据,而不是布局),我希望表头中没有可见的边框.据我所知,这样做的方法是指定border-collaps:collapse;在CSS中.但是,在我的情况下,此后边界仍然可见.我搜索了这个网站,尝试了这里建议的各种解决方案 – border-spacing-0px,display-none – 但没有任何效果 对不起,我知道之前已经提出了类似的问题,但是我的案例中没有提到任何建议.我有一个表(对于表格数据,而不是布局),我希望表头中没有可见的边框.据我所知,这样做的方法是指定border-collaps:collapse;在CSS中.但是,在我的情况下,此后边界仍然可见.我搜索了这个网站,尝试了这里建议的各种解决方案 – border-spacing-0px,display-none – 但没有任何效果.边界仍在那里.我的CSS中的代码现在看起来像这样:

.tableStyle2 {    border-spacing: 0px;}.tableStyle2 th {    background-color: #1B7AE0;    border-color: #1B7AE0;    border-spacing: 0px;}.tableStyle2 tr {    display: none;}

相应的HTML代码如下:

<table class = "tableStyle2" wIDth = "100%"><tr><th> ... </th><th> ... </th><th> ... </th><th> ... </th><th> ... </th></tr></table>

(表格的其余部分尚未写入.)
知道造成这种情况的原因是什么,以及如何隐藏表头中单元格之间的边界?

解决方法 每个< td>确定(并负责)其自己的边界.

.tableStyle2 {    border-spacing: 0px;    border-collapse:collapse;  /* <--- add this so all the internal <td>s share adjacent borders  */    border:1px solID black;  /* <--- so the outsIDe of the <th> don't get missed  */}.tableStyle2 th {    background-color: #1B7AE0;    border-color: #1B7AE0;    border-spacing: 0px;  /* <---- won't really need this if you have border-collapse = collapse */    border-style:none;   /* <--- add this for no borders in the <th>s  */}.tableStyle2 tr {   /* display: none; <--- you want to show the table  */}
总结

以上是内存溢出为你收集整理的HTML – 边框崩溃不再工作全部内容,希望文章能够帮你解决HTML – 边框崩溃不再工作所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1067797.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存