Key Points

  • To apply a simple default border to a table, include the border="1" argument in the table’s opening tag. A value greater than 1 increases the table border but not the cell borders.

  • The frame argument specifies which sides of the table frame display the border; the rules argument specifies which sides of the cell borders display the border.

  • For maximum flexibility, specify borders by using style sheets. Border style arguments in tables are the same as border style arguments around paragraphs: border-width, border-color, and border-style.

  • To format one side of a border individually, specify the side in your argument: border-top-width, border-bottom-style, and so on.

  • You can apply a background color by using the style="background-color: color" ...

Get HTML and XHTML Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.