HomeReferencesHTML Tags

HTML Tag: table

Defines a table used for tabular data.

HTML Dog, The Book HTML Dog book cover

HTML Dog is hosted by Titan Internet

Required Attributes

  • None.

Optional Attributes

  • summary can be used to provide a summary of the data represented in the table.
  • Common attributes
  • Note: There are other valid attributes (border, cellpadding, cellspacing, frame, rules, width) but they are purely presentational and so CSS should be used instead.

Example


<table>
	<tr>
		<th>Question</th>
		<th>Answer</th>
		<th>Correct?</th>
	</tr>
	<tr>
		<td>What is the capital of Burundi?</td>
		<td>Bujumburra</td>
		<td>Yes</td>
	</tr>
	<tr>
		<td>What is the capital of France?</td>
		<td>F</td>
		<td>Erm... sort of</td>
	</tr>
</table>