Lab 3: Page Layout - Tables & Examples

Lab 3: Page Layout - Tables & Examples

In a HTML table cells be spanned across rows and columns in a table using Col Span or RowSpan as per example below:

<!-- Col Span Example -->
<table style="width:100%">
  <tr>
    <th>Name</th>
    <th colspan="2">Telephone</th>
  </tr>
  <tr>
    <td>Bill Gates</td>
    <td>55577854</td>
    <td>55577855</td>
  </tr>
</table>

<!-- Row Span Example -->
<table style="width:100%">
  <tr>
    <th>Name:</th>
    <td>Bill Gates</td>
  </tr>
  <tr>
    <th rowspan="2">Telephone:</th>
    <td>55577854</td>
  </tr>
  <tr>
    <td>55577855</td>
  </tr>
</table>

Tables are a great solution to represent data but I wouldn't use them for anything else such as website layout. One of the biggest draw backs to using html tables is responsiveness to different screen sizes.

Show Comments