Sometimes, we want to completely remove borders from HTML table with CSS.
In this article, we’ll look at how to completely remove borders from HTML table with CSS.
How to completely remove borders from HTML table with CSS?
To completely remove borders from HTML table with CSS, we set the border-collapse
property.
For instance, we write
<table cellspacing="0" cellpadding="0">
<tr>
<td class="first">first row</td>
</tr>
<tr>
<td class="second">second row</td>
</tr>
</table>
to add a table.
Then we write
table {
border-collapse: collapse;
}
to use border-collapse: collapse;
to remnove the border from the table.
Conclusion
To completely remove borders from HTML table with CSS, we set the border-collapse
property.