XHTML Lecture 3 Tables

  1. What are the elements of a table?
    • <table></table> : Defines a table.
    • <tr></tr>: Defines a table row.
    • <td></td>: Defines a table data (columns) and is placed within the row tags.
  2. How do you display a table border?
    <table border="1">
  3. What is needed in empty cells?
    • A non-breaking space (&nbsp;) is needed in empty cells to make the borders visible.
    • You write &nbsp; between the <td> tags.
    • i.e.- <td>&nbsp;</td>
  4. How do you define the size of a table cell?
    • You define the size of a table cell using the colspan and rowspan attributes.
    • <td colspan="2"> stretches the cell across two columns.
    • <td rowspan="2"> stretches the cell across two rows.
  5. How do you use cell padding and cell spacing?
    • <table border="1" cellpadding="10">
    • <table border="1" cellspacing="10">
    • Cell padding defines the space between the cell walls and the content.
    • Cell spacing defines the space between individual cells.
Author
mal808
ID
60192
Card Set
XHTML Lecture 3 Tables
Description
Notes from my XHTML class about tables
Updated