Modifying the appearance of the table

Controlling cell spacing

The cellspacing attribute controls the amount of space inserted between the table cells:

<table cellspacing="value">

where the value is the width of the border in pixels. The default cell spacing is 2 pixels.

cellspacing="0"cellspacing="5" cellspacing="10"
AB
CD
AB
CD
AB
CD




Controlling cell padding

The cellpadding attribute controls the amount of space inserted between the table text and the cell borders:

<table cellpadding="value">

where the value is the distance in pixels from the table text to the cell border. The default cell padding is 1 pixel.

cellpadding="0"cellpadding="5" cellpadding="10"
AB
CD
AB
CD
AB
CD