Basic HTML

 
 
          

Table >> Caption

 

Table Caption

Caption sometimes help to clarify the purpose of a table. Some tables, such as the header and the menu bar tables, do not need captions. Other tables, such as the members tables, benefit from a caption to clarify the contents of the table. A caption can be placed above or below the table using the align=above or align=bottom attributes, respectively.


Examples:

HTML - Code Description Sample Output
<table width=300 border=1 bgColor=#ffffff>
<tr>
<td colspan=2>Boys
<td colspan=2>Girls
<tr>
<td>Mark
<td>90
<td>Mary
<td>98
<tr>
<td>John
<td>100
<td>Grace
<td>80
<tr>
<td>Steve
<td>75
<td>Yzzah
<td>100
<caption align=above>Student Record</caption>
</table>
  • We used align=above for our caption
  • Boys Girls
    Mark 90 Mary 98
    John 100 Grace 80
    Steve 75 Yzzah 100
    Student Record
    <table width=300 border=1 bgColor=#ffffff>
    <tr>
    <td colspan=2>Boys
    <td colspan=2>Girls
    <tr>
    <td>Mark
    <td>90
    <td>Mary
    <td>98
    <tr>
    <td>John
    <td>100
    <td>Grace
    <td>80
    <tr>
    <td>Steve
    <td>75
    <td>Yzzah
    <td>100
    <caption align=bottom>Student Record</caption>
    </table>
  • We used align=bottom for our caption
  • Boys Girls
    Mark 90 Mary 98
    John 100 Grace 80
    Steve 75 Yzzah 100
    Student Record

    Table >> Spanning >> Column Span Table >> Blank Cell