AdBlock Detected!
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.
CSS Table |
In HTML code, you will commonly see the table tag followed by border, cellpadding, and cellspacing attributes. This would be unnecessary if we use CSS. The table, th, tr, and td selectors can use many of the properties we have defined previously in this tutorial such as, but not limited to, those for text, font, border, color, and background. Let's take a look at one example. Assuming that we want the following style applied to the table: We would apply the following stylesheet:
Given this style, the HTML code below:
would render the following:
border-collapseThere is one property related to a table that we want to mention here, and that is the border-collapse property. The border-collapse property essentially replaces the cellspacing=0 declaration. Let's looks at the example below: With this CSS declaration,
the HTML code below,
would render the following:
Notice that the underline between the Year column and the Income column are continuous. The is the effect of border-collapse:collapse. |
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.