DreamweaverFAQ.com
Search the site!Search DWfaq.com | Print This PagePrinter Friendly Page
Current: Default | Default: DWfaq Green


DreamweaverFAQ.com » Tutorials » Tables » Flexible Page Layout Using Tables


Making the Navbar

Design goal: main navigation bar below the banner that covers the width of the content area

I want the next page element--the main navigation bar--to have the same general behavior, but instead of spanning the entire window, I want the buttons to stretch across only the content area. As with the banner, I start by making a 1-row, 2-column table:

   

I have a small graphic to fill the space under the logo to prevent the navigation bar from moving into that area, so I put it into the left cell:

navbar-left  

All but one of the rows of pixels in this graphic are transparent, so I can use a background color to fill in most of the area:

navbar-left  

I want this cell to be only as wide as this graphic. I've sized the graphic to be exactly the same width as the logo in the banner above it. Now I need a way to make the right cell expand to fill all of the remaining width of the table. This is where the buttons for the navigation bar will go. I'll use what I call a "balloon" cell. I select the right cell and set its width to 100%:

navbar-left

< "balloon" cell >


The "balloon" cell forces itself to be as wide as it can be inside its table. The only thing that stops it from expanding any more is the graphic in the left cell. This cell will be the outer container for the navigation bar. Since it will always be as wide as possible, if I make another table inside it, and set its width to 100%, the inner table will always expand to the width of the "balloon" cell.

To make the navigation bar itself, I make a 1-row, 4-column table:

       

and insert my button graphics:

I want to make sure that as the navigation bar expands and contracts the buttons will be in the center of their cells. So I add center horizontal alignment to each cell:

I've made the buttons wider than the words to establish a minimum spacing between them if the window gets very narrow. Now, to fill the gaps between the buttons, I'll add a table background, and set cell space, cell pad and table border to zero:

Now I put this navigation bar table into my outer table:

navbar-left

and set the cell pad, cell space and table border to zero:

navbar-left


See the navbar

Next, we'll build the side navigation panel.

::This page last modified 8/13/2013 at 03:37::

Copyright © 2001-2024 DreamweaverFAQ.com All Rights Reserved.
All brands, trademarks, tutorials, extensions, code, and articles are the property of their respective owners.
A production of Site Drive Inc.
Legal Notice | Privacy Policy | Disclaimer & Notice