Reputation:
I'm trying to apply background-color
to a table-cells. jsFiddle
<table>
<tr>
<td>
text
</td>
<td>
text
</td>
<td>
text
</td>
</tr>
</table>
td{
background-color: rgb(172,0,20);
}
How can I remove spacing between the table cells?
Upvotes: 2
Views: 40
Reputation: 208002
Use CSS:
table {
border-collapse:collapse;
}
Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/border-collapse
Upvotes: 0
Reputation: 3283
Just add the border-collapse
property for the table:
CSS
table{
border-collapse:collapse;
}
td{
background-color: rgb(172,0,20);
}
Upvotes: 1
Reputation: 6730
The space between cells is called cellspacing and can be assigned in the html by using:
<table cellspacing="0">
<tr>
<td>
text
</td>
<td>
text
</td>
<td>
text
</td>
</tr>
</table>
see: http://www.w3schools.com/tags/att_table_cellspacing.asp
You can also do this through CSS, see: Set cellpadding and cellspacing in CSS?
Upvotes: 0
Reputation: 2584
try using like this
<table cellspacing="0" cellpadding="3" border="0">
<tr>
<td>text</td>
<td>text</td>
<td>text</td>
</tr>
</table>
Upvotes: 0