ALS 3203 - Lesson 6
Using HTML to create Tables

Tables are perhaps the most functional tools for a web page designer who does not have access to Style Sheet scripting, Dynamic HTML, and higher order web authoring. Tables allow you to do many things with web page components. Text and images may be positioned in a web page using tables.

Here are a few web sites dealing with tables and HTML (there are many more if you Google html tables):

Table samples: http://wp.netscape.com/assist/net_sites/table_sample.html

Basic table codes: http://personalweb.about.com/library/weekly/aa071502a.htm

 

Tables have only a few components. They are:

  • Border - by default 1 pixel wide, omit this tag (a great technique for positioning items on a page without showing borders) and cells will not have a defined border
  • Cell - the units that make up a table, minimum of 1 cell. If left empty no borders will be drawn.
  • Row - horizontal array of cells in single line
  • Columns - vertical array of cells in single line
Think of rows, columns, and cells as similar to the same named components of spreadsheet applications. Each table cell may contain most HTML tags, including other tables! In spite of their tremendous flexibility tables are composed with only a few HTML tags:
  • <table> - starts a table, requires an ending tag of </table>
  • border - contained within the <table> tag as <table border>creates border around table cells, attributes are units (pixels); default size is 1 pixel.
  • <caption> - places caption outside table, must follow table tag, requires ending tag. Used as <table> <caption>some caption</caption>
  • <tr> - starts a table row, requires an ending tag </tr>
  • <th> - may be used in the first row as column headers, appear bold. Does not require ending tag.
  • <td> - starts a table cell, requires an ending tag </td>
    • Cell contents may be vertically aligned using <td valign="top, middle, bottom or baseline">
    • Similarly, contents may be aligned horizontally by align="left, center, or right"
  • colspan - merges two or more cells across columns (horizontally). Used within the <td> tag, as in <td colspan="2">
  • rowspan - merges two or more cells across rows (vertically). Used within the <td> tag, as in <td rowspan="2">

Begin lesson Lesson 6 Glossary
Today is: | ©P. M. Choate 2009
University of Florida Home Page