Computer Programming 12HTML tables

<New code>

block HTML <table> - contains table data
block HTML <caption> - contains the caption for table
block HTML <thead> - contains the headings for the table
block HTML <caption> - contains the body of the table data
block HTML <tr> - begin a table row
block HTML <th> - contains a table heading cell
block HTML <td> - contains a cell of table data

inline HTML <br /> - creates a new line

Creating tables of information

You are also going to learn how to create tables in HTML. Tables are constructed as a series of nested containers. Think of tables like this:

<table>
	<caption>All I know about pickles</caption>
	<thead>
		<tr>
			<th>Pickle names</th>
			<th>Average pickle rating</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>Polski ogorki</td>
			<td>9/10</td>
		</tr>
		<tr>
			<td>Bread and butter</td>
			<td>6/10</td>
		</tr>
		<tr>
			<td>Banana peppers</td>
			<td>3/10</td>
		</tr>
	</tbody>
</table>

Makes this...

Learn more

Live example: tables