Dreamweaver Tutorials

Get Started in Dreamweaver: Define a new or existing Web site

Find out how easy it is to register a domain name

Designing with CSS

When using CSS, What Selector Type Should You Use?

Customize a CSS Layout in Dreamweaver CS3

Align Images with CSS in Dreamweaver

Create a Navigation Bar with an Unordered List and CSS

Compare Layout Options: Tables, Layers, or CSS

Make your site accessible to all your visitors

Where to learn advanced CSS tips and tricks

AJAX and Spry

Create Collapsible Panels with AJAX using Spry

Adding a Drop-Down Menu with Ajax using the Spry features in Dreamweaver CS3

Working with Multimedia

Insert a Flash File using Dreamweaver CS3

Insert a Flash Video File

Convert Video into Flash with the Flash Video Encoder

Using Behaviors

Use Swap Image Behavior to Create Multiple Rollovers

Swap Image Behavior

Use a Behavior to Launch a New Browser Window

Add new features to Dreamweaver with Extensions

Connect an HTML Form to a Script in Dreamweaver

More Resources

Cool online tools you can use on your Web site

Comparing Web design programs and technologies

Video Training

Discover how training videos make learning fun and easy!

Dreamweaver FAQ

Get answers to your questions, and maybe even a few you hadn't thought of yet, in the Dreamweaver FAQ

Total Training Videos

 

Partners and sponsors

Total Training Online Software Training - Try it Now Get Free Access

Dreamweaver FAQ

Get answers to your questions, and maybe even a few you hadn't thought of yet, in the Dreamweaver FAQ.

Dreamweaver CS3 advertisement CS3-DW-125x125

Free Greeting Card, Expires 2-27-07

Trusted by over 7 million customers!

Total Training

IX Web Hosting ad

If you want to further your website education, an online college degree in this area may help. An online university degree in one of these online degree programs will put your on the fast track to success!

Comparing Layout Options:
Tables vs. Layers vs. CSS

How come I can center my design when I use tables in Dreamweaver, but I can't center Layers?

Create a Centered CSS Layout

Discover how to create a centered, two-column design in Dreamweaver using Div tags and CSS in this tutorial (originally written for Layers Magazine).

When you design a Web page in Dreamweaver you have many options for controlling the placement of images, text, and other elements on your pages.

These days the most recommended approach is to use CSS (you'll find links to tutorials on CSS on the right side of this page).

But long before CSS became an option on the Web, the most popular option was to create a Table in HTML, use the cells as containers for text and images, and then merge and split cells to control positioning. When you create a table, you have the added advantage that you can use the center alignment option to create a page design that stays centered when viewed on different monitor sizes.

Another popular design option of the past is Dreamweaver’s Layers feature. Layers are an attractive choice because they are so intuitive and easy to use to create even the most complex designs in Dreamweaver. You simply click the Layer icon in the Layout Insert panel, and then click and drag to create a layer anywhere on your page. Then you can insert images, text, or any other element into your layer.

Note: In Dreamweaver CS3, Adobe changed the name of this feature from Layers to AP Div (Absolutely Positioned Div tags).

Unfortunately, there are at least two reasons why Layers are problematic in Web designs that you want to display well in a wide range of Web browsers.First you can’t center Layers because they use Absolute positioning, which means they maintain their location in relation to the top and left border of the page no matter what size the browser window. And second, Layers are not adjustable, which means that if you include text in a Layer and your user adjusts the size of the text (many people increase the text size in their browsers for easier reading), the text can be cut off if it excedes the size of the Layer.

And if you combine Tables and Layers in Dreamweaver, the results can be especially problematic. Here’s an example to help you better understand.

If you click and drag to create a layer that is 500 pixels wide and you position it 100 pixels from the left side of the screen and 100 pixels from the top on an 1024 by 768 resolution monitor, that layer will always be 100 pixels from the left and top of the screen, no matter how big a monitor it’s viewed on. So if you look at it on a giant monitor, it will still be 100 pixels from the side and top, there will just be more room off to the right.

centered tables

In contrast, if you create a 500 pixels-wide table and you center it, that table may be 150 pixels from the left side of the screen when viewed on a monitor with 800 by 600 resolution, but it will move to be even further from the left side of the screen when viewed on a monitor with 1024 by 768. In other words, it will adjust to always be centered even if that changes how far it is from the left side of the screen.

Centering Tables and Layers

If you don’t appreciate the difference yet, let me warn you that things get really confusing when you combine tables and layers because although things may look fine when you create them on your monitor, as soon as they are viewed in a different resolution or a different size browser window, the table and layer won’t line up.

So it comes down to this. Your best option is to choose to use Tables or Layers to control your designs, and not to try to combine them. If you do combine them, the only way to ensure consistent positioning in you place a Layer inside a Table is to align your Table to the left side of the screen. Alternatively, you can place a table inside a layer. In that case, because the layer will stay in one place, the table inside the layer will also remain in the same location.

You should know that it is possible to create centered CSS layers, but that’s now how Dreamweaver creates layers when you use the Layer’s tool. It is possible to create centered layers in Dreamweaver, but it gets very complicated very fast and Dreamweaver does not offer much support for this option.

If you want to see how centering CSS layouts works, check out this tutorial on centering a design with CSS, then visit the sites listed below to learn more.

Want to learn more about CSS?

Visit our Dreamweaver Training Center.

 

Partners and sponsors

Order Your Dreamweaver Training Video Today!

 

Partners and sponsors

Shutterfly.com