Creating Site Layout By Using Tables
Print This Post
No CommentRelated Reading |
In order to create a site layout by using html tables, we’ll need a navigation menu, a place to put the actual content of your website, and a place to put some ads, graphics and a logo. There are a few ways we can arrange these items, and we’re going to cover one of them in this lesson.
Your First Website Layout
We’re going to build a website that has a navigation menu along the left hand side. In order to do that, we need a “main” table that has two columns – one reserved for the navigation menu and the other for the content. Note that we’re going to add borders to our table to make it visible, but main tables generally do not have any borders. We’re then going to define the width of our table as “100%” to ensure it fits the screen in all screen resolutions and browser windows. We’re also going to define a width for our navigation menu – it can be both fixed or a percentage depending on your personal taste. We’ll set it to a fixed value of 120 pixels for this particular example.
Let’s write down the HTML code for our “main” table:
| <html> <head> </head> <table border=”1″ width=”100%”> </body> |
The above HTML code will generate the below output:
|
Now, we can add an additional table to the left column to form a navigation menu. We’ll also set the “border” attribute of the “main” table to “0″ (zero) in order to make our site look nicer
Sidenote: Putting a table inside another table is called “nesting tables”. Nested tables are used heavily to create neatly designed websites.
Copy and paste the below HTML code into your notepad to form a simple website with a navigation menu on the left:
| <html> <head> </head> <table border=”0″ width=”100%”> <table border=”1″> </td> </body> |
The above HTML code will create a navigation menu:
|
We can add a logo and some graphics or ads to the top part of our page. To do that we are going to add another row to the top part of our main table:
| <html> <head> </head> <table border=”0″ width=”100%”> <table border=”1″> </td> </body> |
The above HTML code will produce a simple but complete website layout:
|
If you enjoyed this lesson, please link to it
Yup, we’re done! Next lesson of your free online web design course will show you how to change background colors, how to add background images and how to avoid background & foreground color conflicts when designing your websites. Let’s go!








Popular Tags