How to delete border spacing in table
I have a table, first row is like
<tr>
<th>1</th>
<th>2</th>
</tr>
I put a black background to "th". Now the 1 and 2 cells have some kind of border between/separating them... I had a look in source code and I think I found something:
border-collapse: separate;
border-spacing: 2px;
This CSS code is listed in source code as "user agent stylesheettable" and I couldn't enable/disable it to test if this is the problem, but I tried and added the same code but with "none" and "0" parameters but it didn't help neither...
Can somebody help and guide me where is the border from please?
Your table be like below by default and set the css rules on tables ID or Class
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<th>1</th>
<th>2</th>
</tr>
</table>
css:
border-collapse: collapse;
Set a CSS rule on your table:
table {
border-collapse: collapse;
}
You can visit this jsFiddle example and switch the border-collapse property from collapse to separate to see how it changes the table's layout. The border-collapse property can only be collapse, separate, or inherited.
border-collapse: none
is invalid. Try border-collapse: collapse
.
上一篇: 细胞和浮游物?
下一篇: 如何删除表格中的边框间距