Tables:
HTML Table Example Number First Name Last Name Points 1 Eve Jackson 94 2 John Doe 80 3 Adam Johnson 67 4 Jill Smith 50 Example <table style="width:100%"> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <tr> <td>Eve</td> <td>Jackson</td> <td>94</td> </tr> </table> Tables are defined with the
<table>
tag. Tables are divided into table rows with the
<tr>
tag. Table rows are divided into table data with the
<td>
tag. A table row can also be divided into table headings with the
<th>
tag.
Note: The border attribute is on its way out of the HTML standard!
It is better to use CSS. Use the HTML <table> element to define a table Use the HTML <tr> element to define a table row Use the HTML <td> element to define a table data Use the HTML <th> element to define a table heading Use the HTML <caption> element to define a table caption Use the CSS border property to define a border Use the CSS border-collapse property to collapse cell borders Use the CSS padding property to add padding to cells Use the CSS text-align property to align cell text Use the CSS border-spacing property to set the spacing between cells Use the colspan attribute to make a cell span many columns Use the rowspan attribute to make a cell span many rows Use the id attribute to uniquely define one table Begin the table with the <table> tag. Create a table row with the <tr></tr> pair. Signify headings with <th>. Specify ordinary data cells with the <td></td> pair. Add CSS as needed. ----------------------------------------------------------------------------------------------------------------------------
Example with css:
Horse Dogs Bird
Car Grey Car Bike
Boat Ship Aircraft
1 2 3
<style> td { border: 2px solid blue; padding: 0.1em 1em; } </style> <table> <tr> <td>Horse</td> <td>Dogs</td> <td>Bird</td> </tr> <tr> <td>Car</td> <td>Grey Car</td> <td>Bike</td> </tr> <tr> <td>Boat</td> <td>Ship</td> <td>Aircraft</td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> </table>

html5