Tables have attributes as well, some of which are the same as the ones used by other tags, such as the image. The following attributes can be used in the <table> tag:

  • width
    Like before, the width can be set in pixels or percent
  • height
    The height can be set in pixels or percent
  • bgcolor
    Sets the background colour of the table
  • background
    Sets the image to be tiled in the background of the table
  • align
    Decides where the table will be positioned on the screen. Can be set to left, right or center.
  • border
    Decides how big the border of the table will be. It is set in pixels. If the border is set to zero, or left out entirely, the border won't show.
  • cellpadding
    Decides how many pixels of blank space should surround the contents of each table cell.
  • cellspacing
    Decides how many pixels of space go in between each table cell

Most of those attributes can also be used with the table cell tag, except for cellpadding, cellspacing and border.

You can also include the attribute valign. It decides where in the cell the information will appear. It can be set to top, bottom or middle.

Go To Frames
[HTML Basics] | [Introduction To Tags] | [Tables] | [Frames] | [Cascading Style Sheets] | [Test] | [Creating Your First Web Site]