Using a Table for Page LayoutSo far your personal Web site contains the following pages: homePage.html, about.html, books.html, links.html and friends.html. All the pages are displayed at full window width. This is not the most attractive display format. Also, when the pages are printed, the margins will be cut off. It is advisable to have some space between the content of the page and the edges of the window. In this chapter you will:
The figure below illustrates the homePage.html page before the change (as it is now) and following the change, which you are about to make: ![]()
How do you create space between the content of the page and the edge of the window? You will format the entire page as a table with 1 row and 1 column, but:
So, the outcome of this is that there will be a space between the table and the edge of the window, and that is exactly what we want!
The content will be inside the column. The code for creating the table will be as follows: <body...> <table border="0" width="76%" align="center"> <tr> <td> content here </td> </tr> </table> </body> Explanation:
So how do you do this?
Viewing the source code of the HTML page
Building the page layout
You used a table for the homePage.html page layout. Now it is time to format the other Web pages to create a uniform page layout for your Web site. To apply the new layout to all the Web pages that you created, repeat items 1 to 7 for each individual Web page that you made: about.html, books.html, links.html and friends.html. Make sure that you "wrap" the existing content for each page with table tags. Notice that these changes do not replace any existing tag, you just add tags. Note - The default value of the border attribute in the <table> tag is 0 (zero), so it is not really necessary to write border="0" in the code. If you would like to view the table's border, you can change the value from 0 to 1, view the border, and then when you want to hide the border just place the value with 0 again.
|