Styling Tables

The table-related properties:

border-collapseSpecifies how borders on adjacent cells are handled.collapse separate
border-spacingSpecifies the spacing between adjacent cell borders. 1 or 2 <length>
caption-sideSpecifies the location of the caption bottom
empty-cellsSpecifies how borders are drawn on empty cells.hide show
table-layoutSpecifies the layout style for the fixed

Collapsing Table Borders

The border-collapse property controls how to draw borders for the table element. The browser draws a border around the table plus a border around each cell. You can address this by applying the border-collapse property.

            table { 
                border-collapse: collapse; 
            th, td { 
                padding: 2px; 
        <table border="1"> 
Click to view the demo
  HTML CSS Book 

Table Style:
  1. Styling Tables
  2. Configuring Separated Borders
  3. Dealing with Empty Cells
  4. Positioning the Caption
  5. Specifying the Table Layout