Print

Borders can be added around each cell. If you want to do that, do it by defining td in CSS file.  The style rule should be done after defining the table style rule{} that uses the td as the selector. This ways all of the cells will be defined the same. If you have head cells defined with the th{} rule then you should do

th, td{

   /* Style rule for all cells including header */

  border:...
}

The space between the cells are called cell spacing. If you do not want any spacing around the cells then you need to use collapse with border and place this in the table{} style rule.

table{

   /* Center the table and have no spacing around the cell borders */

  margin: 1em auto;

  border:collapse;

}

th, td{

  /* solid border around the cells gray in color */

  border: solid 1px gray;

}

 Padding around the information in the cells will make it easier to read the information.  The padding should be added to each cell top, bottom, left and right sides.  This is done in the cell style rule not the table style rule

th, td{

  /* solid border around the cells gray in color */

  border: solid 1px gray;

  /*Add padding of 2 px above and below the information and 4 px  on left and right side of each cell */

  padding: 2px 4px;

}

Comments (0)

500 characters remaining

Cancel or