| Table HTML: |
This page contains a table HTML tutorial.
For Basic HTML go here
Basic Tables:
Tables are made up of a table tag <table> a table row tag <tr> and a table data tag <td> They need to be in the correct order and all table tags need their closing tags. </table> or </tr> or </td>
<table border=1><tr><td> Words </td></tr></table>
| Words |
<table border=1><tr><td>Words1 </td><td>Words2 </td><td>Words3</td><td>Words4 </td></tr></table>
| Words1 | Words2 | Words3 | Words4 |
Notice there is only one opening and one closing <tr> </tr> tag and all the <td> and </td> tags are enclosed by them.
<table border=1><tr><td> First row </td></tr><tr><td> Second row</td></tr></table>
| First row |
| Second row |
Notice that each data still needs to be enclosed by a <td> and </td> tag.
<table border=1><tr><td> Words1 </td><td> Words2</td><td>Words3</td></tr><tr><td> Words4</td><td>Words5</td><td>Words6</td></tr></table>
| Words1 | Words2 | Words3 |
| Words4 | Words5 | Words6 |
Somewhat advanced Tables:
<table border=1 bgcolor=yellow><tr><td> Words </td></tr></table>
| Words |
<table border=0 bgcolor=yellow><tr><td> Words </td></tr></table>
| Words |
<table border=5 bgcolor=yellow><tr><td> Words </td></tr></table>
| Words |
| Words |
| Words |
<table border=1><tr><td height=50 width=100> Words1 </td><td> Words2</td><td>Words3</td></tr><tr><td> Words4</td><td>Words5</td><td>Words6</td></tr></table>
| Words1 | Words2 | Words3 |
| Words4 | Words5 | Words6 |
<table border=1 width=100%><tr><td> Words1 </td><td> Words2</td><td>Words3</td></tr><tr><td> Words4</td><td>Words5</td><td>Words6</td></tr></table>
| Words1 | Words2 | Words3 |
| Words4 | Words5 | Words6 |
<table border=1 width=100%><tr><td align=right valign=top height=50> Words1 </td><td> Words2</td><td>Words3</td></tr><tr><td> Words4</td><td>Words5</td><td>Words6</td></tr></table>
| Words1 | Words2 | Words3 |
| Words4 | Words5 | Words6 |
Note: vertical alignment for the words in a cell uses "valign" and the words "top" "middle" and "bottom". Horizontal alignment uses the "align" tag and the words "left" "right" and "middle".
<table border=1 width=100%><tr><td> Words1 </td><td width=60%> Words2</td><td>Words3</td></tr><tr><td> Words4</td><td>Words5</td><td>Words6</td></tr></table>
| Words1 | Words2 | Words3 |
| Words4 | Words5 | Words6 |
| Words1 | Words3 | |
| Words4 | Words5 | Words6 |
Or vertically:
<table border=1><tr><td rowspan=2> Words1 </td><td> Words2</td><td>Words3</td></tr><tr><td>Words5</td><td>Words6</td></tr></table>
| Words1 | Words2 | Words3 |
| Words5 | Words6 |
|
<table border=1 cellspacing=4 cellpadding=5><tr><td><table border=0 cellpadding=5 bgcolor=white><tr><td bgcolor=red><u><b>Discount</b></u></td><td bgcolor=lightblue> Price </td><td align=right bgcolor=lightblue>Size</td></tr><tr> <td align=right rowspan=2>without <p> surcharge</td><td align=right> $ 223</td> <td align=right> 32"</td></tr><tr> <td align=right>$ 14</td><td align=right>6"</td></tr><tr> <td align=right rowspan=2> with <p> surcharge</td><td align=right> $ 140</td><td align=right bgcolor=blue><font color=white>18"</font></td></tr><tr> <td align=right>$ 6</td><td align=right>3"</td></tr></table></td></tr></table>