Dreamweaver question

Associate
Joined
28 Dec 2002
Posts
2,400
Location
Northern Ireland
hi guys,
how do i keep everything centered when working in dreamweaver so that everything is centered when viewing it in a web browser??

do i use tables or something??
 
Tables are still the most reliable way to do page layout, less faffing around than with CSS.

Just insert a table, make it a fixed width of say 760 pixels, and then once you've added the table to your page, you can set its alignment property to "center" to centre it on the page.

If you want the text within the table centred, then select the cell within the table (ctrl click within the table) and set Horz alignement to "center".

Whatever you do when you create web pages, keep your underlying table structure extremely simple for layout purposes ... oh, and avoid the CSS layout purists, CSS layout is not worth the pain.

Rgds
 
if your serious about creating websites i'd suggest ignoring the advice above. tables should be used for tabular data only. Use Div's and spans for layout along with CSS.

If you go into a company creating sites or do it professionally yourself in the future you will be required to code correctly as part of coding standards. Once your familiar with what you can achieve without tables it becomes just as easy.
 
the above will probably work but not the correct way to go about things. using <center> your in effect styling how you want things to look which should be the job of the css.

if you want to use div's and css the best way to style it is with the following css
applied to the div you need centering.

Code:
width:500px; /* width of your centered div*/
margin:0px auto;
 
Not to mention Dreamweaver handles CSS anyway, so why you'd need to use tables over CSS makes no sense when it handles both with ease.

No reason to use tables, unless as Gman said, you are displaying tabular data...

There are a few exceptions where you need tables but for the most part there's no reason to avoid CSS.

I can see why CSS is awkward for some people, but i found after using it long enough it became second nature and quite confident i can get all my data displayed as i want without having to use tables. I'm working on my own little website at the moment (local install), which has various pages and forms without any tables... (It wasn't hard, no chore, no problem, simple straight forward CSS)

Borrowed a few scripts for bits and pieces, again i stripped out the tables and replaced with DIV, H1, P, etc... tags and got the look i wanted without having to compromise layout...

For some things you can center using minor CSS....

CSS
.thisclass {margin:0 auto 0 auto;}

HTML
<div class="thisclass">
or
<a href="your links" class="thisclass">

or any other tag you wanted to apply that to...
 
Last edited:
There's no excuse when Dreamweaver can handle stylesheets to.... :)

I've actually (admittedly) started using the CSS features in DW today, normally i do most by hand in notepad2, but the built in support has been dead handy for what i've been doing today... which was basically building a new template layout, the existing one was working fine but needed a 'fine tune' so to speak, so i just started fresh and laid out things slightly differently, which has actually worked out better overall for the content.... :)

Perhaps if RF has DW he should take another closer look at it.... it doesn't come with that huge price tag for nothing....
 
I suggest ignoring radderfires advice here. tables have not been the correct way to go for years. use the margin 0 auto css thing. thats what i always use.
 
Since people are already discussing it - I've always been an advocate of using CSS rather than tables. Truth of the matter is, I have no idea why. Mostly just because it's the 'standard.' I mean CSS involves using so many hacks it's unreal... Can anyone shed any light on this issue for me?
 
Since people are already discussing it - I've always been an advocate of using CSS rather than tables. Truth of the matter is, I have no idea why. Mostly just because it's the 'standard.' I mean CSS involves using so many hacks it's unreal... Can anyone shed any light on this issue for me?
1. Because using tables for presentation and layout stops the content from having a natural hierarchy in its purest form, as all language-based content should have [from headings and sub-headings down to paragraphs];

2. Table-based layout code is mixed in with the content code, making content more difficult to maintain manually;

3. Spiders for search engines can't differentiate between layout code and content code, effectively diluting the 'appeal' or relevancy to searches. As far as I'm aware, most spiders only look at a certain number of lines of a site's page's code. The more of those lines that are taken up by layout code and not content code, the poorer the site's results in searches.

4. Site-wide changes to style and layout can be implemented much more easily with CSS; table-based layouts require considerably more time and effort, as a rule.


There are bound to be more compelling reasons that I can't think of right now - hey, it's late - but in a nutshell: yeah, use CSS.

A few hacks here and there don't add up to much extra maintenance. If scores of CSS hacks need to be employed, then that's a sure sign that either the markup or the design is fundamentally flawed.

CSS hacks have only ever existed to counter many years of accumulated browser idiosyncrasies [he said, diplomatically ;)]. As browsers evolve to conform with a set of standards - something that is slowly but surely happening - the number of hacks required plummets, thankfully. Yeah, IE6, I'm looking at you.
 
Last edited:
The guy is just starting out.

Yes, I still use tables for layout but my background layout is always incredibly simple (1 table, 2 columns). This means that my web pages always display correctly in every browser I have ever used, and I never have to spend any time tweaking divs, using special corrections, or generally pulling my hair out.

Each to their own, but this works for me and is definitely my advice for newbies. I am an advocate of very simple design and appreciate that others may like to do things differently.

I do use CSS for formatting however. :D

Rgds
 
The guy is just starting out.

Yes, I still use tables for layout but my background layout is always incredibly simple (1 table, 2 columns). This means that my web pages always display correctly in every browser I have ever used, and I never have to spend any time tweaking divs, using special corrections, or generally pulling my hair out.

Each to their own, but this works for me and is definitely my advice for newbies. I am an advocate of very simple design and appreciate that others may like to do things differently.

I do use CSS for formatting however. :D

Rgds

No point getting into bad habits, better to learn it right first time. If you're using a simple design it's unlikely you'll have to use any hacks anyway.

1. Because using tables for presentation and layout stops the content from having a natural hierarchy in its purest form, as all language-based content should have [from headings and sub-headings down to paragraphs];

2. Table-based layout code is mixed in with the content code, making content more difficult to maintain manually;

3. Spiders for search engines can't differentiate between layout code and content code, effectively diluting the 'appeal' or relevancy to searches. As far as I'm aware, most spiders only look at a certain number of lines of a site's page's code. The more of those lines that are taken up by layout code and not content code, the poorer the site's results in searches.

4. Site-wide changes to style and layout can be implemented much more easily with CSS; table-based layouts require considerably more time and effort, as a rule.

I think those are the main reasons, basically comes down to design and content being easier to manage when separate and there being less problems for programs which are only concerned with content.

Some other reasons are:

Accessibility - Different CSS files can be defined for different mediums such as printers and PDAs. Screen-readers and text-mode browsers can simply ignore the CSS as they are only concerned with the content.

Saves bandwidth - Not a big deal for most people I imagine given the bandwidth of text, but in some cases it can actually be quite significant.
 
Using tables is easier if you are just starting out. I'm an ICt teacher and when teaching web design to year 8's, I use tables, only as it would would be a right pain to show them to code CSS. The noise they make if they accidentally hit eh Code view button :eek:
 
So are you suggesting the OP should be given advice equivalent of that given to a year 8?

Tables are easier, but that really depends who is being taught, who by and what that person's learning curve is like for web coding, and how determined that given person may be to soak it all in and apply it.

For ease - tables
For better practice - CSS

If you're working with Dreamweaver it's dead simple to use CSS, it's a matter of clicking on a few differnet icons/buttons/menus instead of the table ones.

This may not apply to the OP, but have a look at this guide...
http://www.layersmagazine.com/dreamweaver-navigation-bar-css.html

In particular choose that one as it shows how easily and readily available the CSS options are in DW. Why ignore them and use tables when the options and usability is right there in front of you in plain english?
 
Back
Top Bottom