Tables are an important part of web pages. For one they allow information to be displayed neatly in a table form. But the also allow the designer of the page to set out the page neatly. For example, a newsletter, usually done as a publication sort of thing where there a graphics all over the place and paragraphs of text split into 2 columns etc. By using tables you could set out a page almost any way you want. Although tables are used in this page, it is frames that are used to get a separate navigation bar and heading.
- <TABLE></TABLE> - The Table. The opening and closing tags declaring that anything between these tags is to be a table. The TABLE tag can be treated like the BODY tag. It can have a background colour, text colour, link colour etc. all set the same way as in the BODY tag.
- <TABLE BORDER="?"> - Table Border. The size of the border to surround the table (in pixels).
- <TABLE CELLPADDING="?"> - Cell Padding. The space between the text and the inside line of the cell's or table's border.
- <TABLE CELLSPACING="?"> - Cell Spacing. The space between the inside line and outside line of the borders.
- <TABLE WIDTH="?" HEIGHT="?"> - Table Size. The width and the height of the table can be specified in pixels or as a percentage.
- <TR></TR> - Table Row. To start a row in the table, the <TR> tag is used. Note: the <TR> tag must be used in between the <TABLE> and </TABLE> tags, and there must always be at least one row in a table. In the latest HTML versions, table, separate rows and even individual cells can all have their own characteristics (BGCOLOR, TEXT and LINK colour).
- <TR ALIGN="?"> - Row Alignment. The alignment of a particular row can be set using ALIGN="LEFT, RIGHT, CENTER". The vertical alignment can also be set using VALIGN="TOP, MIDDLE, BOTTOM".
- <TD></TD> - Table Cell. A table cell is where all the information goes. The table rows are just used to set up the table cells, and it is a combination of table rows each having a combination of table cells that make the complex tables. Each individual cell's background and text properties can also be changed by using BGCOLOR="#??????", TEXT="#??????" etc.
- <TD ALIGN="?" VALIGN="?"> - Cell Alignment. The alignment of each individual cell can also be changed the same way each row's alignment was changed. (LEFT, CENTER, RIGHT)
- <TD WIDTH"?"> - Cell Width. When you require tables to be exact, ie have an exact size and all the cells to be a certain size, you change the cell width. The cell width can be set as a number of pixels or as a percentage of the table width.
- <TD COLSPAN="?"> - Column Spanning. This option sets the number of columns the cell is to span. The default value is 1.
- <TD ROWSPAN="?"> - Row Spanning. The same as column spanning, row spanning allows a cell to span a number of rows. You will find these tags useful when creating complex table that have a plethora of merged horizontal and vertical cells.
- <TD NOWRAP> - No Line breaks. This tag is used when you require no line breaks in a cell. Performs the same function as the <NOBR></NOBR> tag.
A Simple Table: Click Here to open example in an new window.
<TABLE BORDER="4">
<TR>
<TD>1st Cell</TD>
<TD>2nd Cell</TD>
</TR>
</TABLE>
More Complicated Table: Click Here to open example in an new window
To see the tags used, view the example source with Notepad ow similar text editor.
http://www.htmlguide.findhere.com |
Copyright © 1999 Robert Duncan |