Table and Column Widths

To determine the width of a table on your web page use the WIDTH attribute in the <TABLE> tag. You can use a % of the page or a pixel number.

In this table the WIDTH=40%
<TABLE WIDTH=40% BORDER=2>

Lunch Favorites
Grade Pizza Hamburger Spaghetti
Grade 4 15 5 5
Grade 5 13 9 6
Grade 6 10 11 5

In this table the WIDTH=80%
<TABLE WIDTH=80% BORDER=2>

Lunch Favorites
Grade Pizza Hamburger Spaghetti
Grade 4 15 5 5
Grade 5 13 9 6
Grade 6 10 11 5

Column widths can also be assigned to the <TH> or <TD> using %'s of the table or pixels.

In this table the column widths are set to 25% forcing all the columns to be the same width.

<TH WIDTH=25%>...</TH> and <TD WIDTH=25%>...</TD>

Lunch Favorites
Grade Pizza Hamburger Spaghetti
Grade 4 15 5 5
Grade 5 13 9 6
Grade 6 10 11 5


Search The Global Classroom
Patricia A. Weeg
pweeg@shore.intercom.net
Return to Global Classroom