![]() ![]() ![]() ![]() ![]() ![]() Web Rings Credits ![]() Critique Sign In Guestbook ![]() Get your FREE web site! |
<Tables> | ||||||||||||||||||||||||||||
To make a table for your web page you use the <TABLE> and </TABLE> tags. Using the BORDER attribute inside the <TABLE> tag allows you to control whether the borders of your table are visible or not. A basic table has rows and cells. You define them using the <TR>, <TH>, and <TD> tags. Look at the following example:
<TABLE BORDER> Which gives you this:
Setting the BORDER attribute in this case turns the borders on. Setting BORDER=0 turns them off. Borderless tables are usefull if you want to use the table for text and graphics layout or positioning. The <TR> tags define the table row. The first cell in the row uses the <TH> tags to create the table heading. Table headings are in bold text. The other cells are normal text and are defined using the table data, <TD>, tags. Empty CellsEmpty cells are a useful part of HTML. They are defined like this:
<TABLE BORDER> Which gives us:
Notice the blank cell in the upper left corner of the table. If you put a <BR> tag between the <TD> and </TD> tags there will be an empty cell instead of a blank one as in this example. Notice that the <CAPTION> tags give you a nice title for the table. The ALIGN attribute has a few possibilities. They are, TOP, which is the default, and BOTTOM. These work for most browsers, except Internet Explorer which uses VALIGN= for top and bottom alignment, and ALIGN=(LEFT, RIGHT, or CENTER) for aligning the caption horizontally. Table AlignmentTable alignment and text wrapping work just about the same as with images. You use the ALIGN= attribute inside the <TABLE> tag and use the following arguments:Cell AlignmentThere are two attributes that control the alignment of data within the cell. They are ALIGN and VALIGN. The ALIGN attribute has three arguments. They are LEFT, CENTER, and RIGHT. Of course the control the placement of objects from left to right. VALIGN controls placement up and down with the following arguments, TOP, MIDDLE, and BOTTOM. The format is:<TD ALIGN=argument VALIGN=argument>DATA</TD> You may use the ALIGN and VALIGN attributes inside the <TR> tag to align an entire row. However, the attributes inside the <TD> tags will over ride them. Combining cells to make HeadingsYou can make a heading row on top of your table or anywhere else in your table by using the COLSPAN or ROWSPAN attributes. Check this out.
Here's the code for the above table:
<table border> Links and Graphics in Your TableYou can put any graphic or link into a table, like this:
<table border> Which looks like this:
I had to get in one more plug for my ship. Table Odds and EndsThe <br> tag and the NOWRAP attribute are helpfull if you have cells in your table with long text and want to control the way the text is broken up in the cell.
Cell Spacing is the width of the lines that make up the table grid. It is controled by the CELLSPACING attribute inside the <TABLE> tag. Border width is controlled by the number after the BORDER attribute inside the <TABLE> tag. Cell padding is the distance between the object in the cell and the cell border. Its attribute is CELLPADDING and it goes in the <TABLE> tag. Cell color can be varied by including the BGCOLOR attribute in the <TH> or <TD> tags.
To learn more about HTML, Site Design and Management, check out the books in my Book Store. ![]() ![]() ![]() |
|||||||||||||||||||||||||||||
Copyright © 1997 by Jim Meeker | |||||||||||||||||||||||||||||
E-mail: jim314@oocities.com
ICQ: 724480 Updated on: 1/17/98 21:11:34 CST |