Archive
This post is archived and may contain outdated information. It has been set to 'noindex' and should stop showing up in search results.
Cross-Browser CSS Remove Table Borders Without Cellpadding Or Cellspacing
Jul 8, 2014Web DevelopmentComments (0)
This very simple CSS allows you to create uniform cross-browser tables, without inserting the outdated "cellpadding" or "cellspacing" properties into your HTML. It's as simple as this:

table {
border-collapse: collapse;
}

This collapses the borders, leaving no spacing between cells. You can then add your own padding and borders with something like:

tr, td {
padding: 2px 4px;
border: 1px solid #888;
}

It's that simple. This works all the way back to Internet Explorer 6.
Comments (0)
Add a Comment
No comments yet