Style Sheets
  Home arrow Style Sheets arrow Page 4 - Designing Web Pages without Tables
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
STYLE SHEETS

Designing Web Pages without Tables
By: Sasha Slutsker
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 69
    2004-08-09

    Table of Contents:
  • Designing Web Pages without Tables
  • No Tables for Layout
  • Absolute Positioning, Add Borders and Margins
  • Lack of Browser Support

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Designing Web Pages without Tables - Lack of Browser Support


    (Page 4 of 4 )

    Lack of Browser Support

    One problem with developing in CSS is lack of browser support. Mozilla and Opera both have excellent up to date support, but Internet Explorer is lagging behind. Everything discussed in this article is supported by the newest version of each browser, but old versions of Internet Explorer and Netscape Navigator do not necessarily support CSS. (Mainly Version 4 of both browsers.) It is easy to detect these browsers with PHP and send them different content. (How to actually do it is out of the scope of this article.)

    Also, as I noted before, there are a couple more ways to position an element. However, these other methods have little or bad support by browsers. A very good way to position an element would be position: fixed, but the lack of support by Internet Explorer is a major turn-off for that. Otherwise, absolute positioning will pretty much get the job done since it is more flexible than other methods of positioning.

    Inconsistencies Between Browsers

    Most people are updated with the latest versions of their browser, so you should not be as concerned there. Different browsers will actually render your same CSS code differently. The main browser to do this is Internet Explorer which may render your borders incorrectly or interpret your "top" attribute strangely. Basically, just test your code in all browsers. I have been known to give different CSS code to Internet Explorer and Mozilla on some occasions, although you should try to avoid this if at all possible.

    Add the <div>'s in

    Adding in the <div> tag to tie all this together is simply accomplished using this:

    <div class = "leftnav">

    // Insert Links

    </div>

    That's it! There is no other secret to writing the (X)HTML part of the page. Most of the work is done in the CSS file. Also, remember that with proper absolute positioning, you can put the <div> tags anywhere on the page. (A lot of people put there content before there layout links because it makes the site look better on the search engines.) Here is a simple XHTML page which will have a three column layout with the right CSS code.

    <div class = "content">

    // Content

    </div>

    <div class = "leftnav">

    // Links

    </div>

    <div class = "rightnav">

    // Links

    </div>

    Now, if that isn't simple, I don't know what is.

    Conclusion

    Well, I hope you learned something about designing web pages with CSS and I hope you decide to implement it on your site. CSS is a great tool and offers a lot of flexibility in how your website is displayed.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Since ALL browsers use table consistently, and not all browsers use CSS...
       · You keep using tables, and the rest of us will take what you call a job. Oh, and if...
       · you are right to continue to use tables for now. A year or two down the road, CSS...
       · that's Netscape 4.7
       · Looks like tables are still good enough for Dev Shed sites.
       · I decided to put the table/css debate aside for a moment to try creating the css...
       · unless your designing for an intranet where you can control the browsers used, stick...
       · You need to add the CSS code that defines the content, rightnav, and leftnav...
       · Also, you can see an example of a site written in completely valid XHTML/CSS here:...
       · The Solar Conflict site is simple yet elegant. It taught me all I need to know to...
       · Yes you can make really good web sites with CSS : but if you want to know how to do,...
       · For my site, I've used the display: inline and display: table-cell commands, to get...
       · This site is "devoted" totally to css and shows how flexible it really can be in the...
       · I forgot exactly the code I used, but try something like border-margin:0; it could...
       · but it is aggravating that IE renders pages so differently than all the other...
       · 
       · It's easy to label developers that still use tables as ignorant and afraid of...
       · Actually I find that when I'm trying to make pages accessible CSS is more of a help...
       · Actually I find that when I'm trying to make pages accessible CSS is more of a help...
       · Um, Sasha, did you know your name reads Sasha Slut in the article listing? Call me...
       · The opening css design on "zen garden" renders terribly in IE5.0. To be specific,...
       · I'm curious. Am I the only one that uses CSS with tables? I used divs too, but it...
       · I too have seen the ramifications of IE being way to forgiving and Netscape seeming...
     

    STYLE SHEETS ARTICLES

    - Image Replacement CSS Techniques
    - Using BlueTrip`s Success, Notice and Error C...
    - More Uses for the Thin and Caps CSS Classes ...
    - Styling Definition Lists with the BlueTrip C...
    - Styling Unordered and Ordered HTML Lists wit...
    - Using the BlueTrip CSS Framework`s Thin and ...
    - Adding Borders to Web Page Columns with Blue...
    - Introducing the BlueTrip CSS Framework
    - Using a Background Grid to Assist Web Page L...
    - Extending the Rule Of Thirds for Web Page La...
    - A Two-Column Web Page Layout Based on the Ru...
    - Using the Rule Of Thirds for Web Page Layout
    - Swapping Columns Using the Divine Ratio for ...
    - Using the Golden Ratio in Liquid Web Page De...
    - Fundamental Design Principles for Web Page L...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek