This page will walk you through a series of example table layouts ranging from simple to complex to help you get the hang of things. You can use the interactive buttons below each example to switch between the layout view and the source code used to create the layout. The source code is expanded and commented to help you visualize what's going on behind the scenes.
Feel free to copy and paste the code into an HTML or text editor and then save it as an .htm file in order to preview the resulting web page. (Please see How to Make a Web Page if you have no idea what I'm talking about.)
In the following examples, keep in mind that I've thrown in some fonts and background colors for demonstrational purposes only. The focus here is intended to be primarily on page structure.
This is a basic two-column web page layout. The left column or the menu column is a narrow band of space (usually between 15-25% of the page width) and is reserved for a menu of hyperlinks leading to other pages on your website. The table used to create this layout employs a single table row containing two table cells.
The right column or the content column takes up the lion's share of the web page width and contains the actual content of each particular page. In a basic two column layout like this, it is common to place the website logo at the top of the content column on each page.
Here's a two column layout with a header section that spans the width of both columns. The first table row creates the header and contains a single table cell which uses the colspan="2" attribute-value pair. The website logo typically goes in the header section.
The second table row contains two table cells which create the menu column (left) and the content column (right). The colspan attribute is not set in either so they default to colspan="1".
Here's a two column layout with header and footer sections that span the width of both columns. The first table row creates the header and contains a single table cell which uses the colspan="2" attribute-value pair.
The second table row contains two table cells which create the menu column (left) and the content column (right). The colspan attribute is not set in either so they default to colspan="1".
The third table row creates the footer. Like the header, it contains a single table cell which uses the colspan="2" attribute-value pair.
Here's a two column layout with header, navigation bar and footer sections. The first two table rows create the header and the navigation bar and contain a single table cell each. These table cells use the colspan="2" attribute-value pair.
The third table row contains two table cells which create the menu column (left) and the content column (right). The colspan attribute is not set in either so they default to colspan="1".
The fourth table row creates the footer. Like the header and the navigation bar, it contains a single table cell which uses the colspan="2" attribute-value pair.
A three column layout with header, navigation bar and footer sections. The first, second and fourth table rows create the header, navigation bar and footer respectively and contain a single table cell each. All these table cells use colspan="3" attribute-value pair.
The third table row contains three table cells which create the menu column (left), the content column (middle) and the extra column (right).
So let's say that you've got your web page all laid out nicely, you dropped in some content and have now developed a distinct hankering to click copiously on the upload button in your FTP program. Well hey... All the power to ya, my friend, but before you start taxing your hosting account's bandwidth allotment, you might want to review some basic web design tips. And to avoid cramping your style, instead of detailing exactly what to do in order to make a nice looking web page, we'll go over what not to do. In other words, let's learn how to make a real crappy web page...