views:

72

answers:

2

I am new to web-design. I want to set the page-width so that it appears well in a 800x600 resolution screen. I normally use Tables but I read somewhere that excessive use of Tables slows the performance of the website. What other thing I can use and how to set the width?

+1  A: 

Yes, Tables are so 1995....

Now you're supposed to use DIVs and SPANs.

http://www.smashingmagazine.com/2009/04/08/from-table-hell-to-div-hell/

also, w3schools are the normal resource for html starters

but, why bother, you can use an already made layout from websites like: http://www.freelayouts.com/websites/html-templates

Faruz
it can be so hard to get `div`s to work properly, but I'm always so proud of my markup when I'm finished.
Carson Myers
+2  A: 

Usings DIVs rather than tables would look like this

   <div style="width:800px">
     <!-- your content here -->
   </div>

This produces on column with the width of 800 pixels. Keep in mind that you normally may put your style definitions in an externals *.css file. In reality you will have some nested DIVs too which hold e.g. your main menu and content e.g.

   <div id="wrapper">
     <div id="topMenu">
       <!-- menu items -->
     </div>

     <div id="content">
       <!-- content -->
     </div>
   </div>

Here I have used IDs for specific items which can be addressed uniquely. It's easy to assign styles to them via CSS:

#wrapper {
  width:800px;
}

#topMenu {
  width:800px;
  height:200px;
}

Sooner or later you will stumble upon the term "floating divs" which is another big topic.

david
+1 But there's no reason for `topMenu` to have the width repeated, is there? As it's a `div`, it'll expand to the full width of its container (one of the things I like about `div` s).
T.J. Crowder
Thx. Yes your are right.
david