HTML Tutorial - HTML table borders

The table element defines the border attribute.

Most browsers draws borders around the table and each individual cell.


The following code shows the application of the border element.

  <table border="1">
        <th>2nd Favorite:</th>
  </table><!-- w  ww.  j  a  v  a2s .  co  m-->

Click to view the demo


The value assigned to the border attribute must be 1 or the empty string (""). This attribute doesn't control the style of the border.

The style of the border is controlled by CSS