HTML 表格无法去除边框
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13986389/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
HTML table can't remove borders
提问by Digital fortress
I know this might be trivial, but I really can't figure out what's going wrong.
我知道这可能是微不足道的,但我真的无法弄清楚出了什么问题。
I can't remove the borders from my table.
我无法从我的桌子上移除边框。
Here is the HTML
这是 HTML
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: none;padding: 0">
I also tried
我也试过
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:0;padding: 0" class="nothing">
but it was no use. Thanks.
但没有用。谢谢。
回答by
You should also set border:none;
and outline:none;
for the td element (not only for the table itself) and border-collapse: collapse;
你也应该设定border:none;
并outline:none;
为TD元素(不仅对表本身)和border-collapse: collapse;
Since you're having the class "nothing", try:
由于您的课程“没有”,请尝试:
.nothing
{
border-collapse:collapse;
}
.nothing td
{
border:none;
outline:none;
}
回答by Tetaxa
Try border-collapse: collapse
尝试 border-collapse: collapse
https://developer.mozilla.org/en-US/docs/CSS/border-collapse
https://developer.mozilla.org/en-US/docs/CSS/border-collapse
回答by Levin
Just try this:
试试这个:
style="border-collapse: collapse;"
see: http://www.w3schools.com/cssref/pr_tab_border-collapse.asp
见:http: //www.w3schools.com/cssref/pr_tab_border-collapse.asp