HTML <table> tag

Usage

Defines an HTML table, inside which you can put table headers (th), table rows (tr) and table cells (td).

Example

Code:

<table border="1">
<tr>
<td>Row 1, cell 1</td>
<td>Row 1, cell 2</td>
</tr>
<tr>
<td>Row 2, cell 1</td>
<td>Row 2, cell 2</td>
</tr>
</table>

Output:

Row 1, cell 1 Row 1, cell 2
Row 2, cell 1 Row 2, cell 2

Required Attributes

  • none

Optional Attributes

  • border - border thickness in pixels. Note that you can use CSS to gain greater control over this
  • cellpadding - specifies the padding between cell walls and content
  • cellspacing - defines the space between individual cells
  • frame - specifies which sides of the table border will be displayed - void, above, below, hsides, lhs, rhs, vsides, box, border
  • rules - sets the properties of the horizontal and vertical divider lines - none, groups, rows, cols, all
  • summary - allows you to set a summary of the table for non-visual web browsers
  • width - the width of the table, in pixels, ems or %

Core Attributes