PageTutor.com

Let's get rid of Ed's friends for now.

<table border="3" width="75%">
<tr>
<td>Ed</td>
</tr>
</table>
Ed

Let's reduce the table size to 50% of the browser window.

<table border="3" width="50%">
<tr>
<td>Ed</td>
</tr>
</table>
Ed

Now we will specify a width of 50 instead of 50%.

<table border="3" width="50">
<tr>
<td>Ed</td>
</tr>
</table>
Ed

Now 100.

<table border="3" width="100">
<tr>
<td>Ed</td>
</tr>
</table>
Ed

As you can see there are two ways to specify table width. Each style has its uses. Which style to use for what is unimportant now.


We can also mess around with the height.

<table border="3" width="100" height="75">
<tr>
<td>Ed</td>
</tr>
</table>
Ed

I'm reminded of something Steven Wright said...

"The other day, I was walking my dog around my building...on the ledge. Some people are afraid of heights. Not me, I'm afraid of widths."

Note: Controlling a table's height is fairly simple. Controlling the height of individual cells within the table is a little unreliable, especially across different browsers.
 
It's also useful to know that the height attribute in the <table> tag is not a part of any official HTML specification (although it is allowed in the <td> tag). That said, table height has been consistently recognized by web browsers for years and there's no reason to believe that will change anytime soon.

<< BACK NEXT >>
PageTutor - Table Tutor
Lessons: Intro 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Tables Quick Reference      Barebones HTML Guide
Print version of this tutorial available - Get the PageTutor book & CD