IT Hardwares

eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 
eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 
Business & Money
Technology
Women
Health
Education
Family
Travel
Cars
Entertainment
Featured Sites
SD Editorials
Online Guide and article directory site.
Foodeditorials.com
Over 15,000 recipes & editorials on food.
Lyricadvisor.com
Get 100,000 Lyric & Albums.
  • Business & Money
    • A Guide to Business
    • Guide to Finance
    • Ideas for Marketing
    • Legal Guide
    • Guide to Insurance
    • Lettre De Motivation
    • Guide to the Stock Market
    • Human Resource Career
    • Sales Marketing
    • Forex & Trading
    • Advertising & Marketing
    • Startup Guide
  • Technology
    • Guide to Technology
    • Cell Phones
    • Computer Software
    • IT Hardwares
    • Internet
    • Online Security
    • Cameras
    • Search Engine Optimization
    • Science & Technology
  • Women
    • Guide to Women
    • Relationship Advice
    • Marriage
    • Jewelry
    • Pregnancy
    • Fashion Style
    • Divorce Guide
    • Wedding Guide
    • Dating Guide
    • Natural Beauty
  • Health
    • Guide to Health
    • Guide to Medical
    • Plastic Surgery
    • Weight Loss
    • Sports
    • Body Wellness
    • Cancer Treatment
    • Common Illness
    • Health & Lifestyle
  • Education
    • Military Service
    • Politics and Policy
    • Arts & Humanities
    • Education and Teaching
    • Learn Languages
    • Colleges & Universities
  • Family
    • Quality Home Improvement
    • Hobbies and Interests
    • Family Guide to
    • Pet Guide
    • Loans Guide
    • Credit Cards
    • Gardening Guide
    • Home Security
    • Real Estate
    • Home Decor
    • Gift & Present
  • Travel
    • The Travel Guide
    • Adventure Travel
    • Cruise Ships
    • Beach Holiday
    • Travel Accommodation
    • Holiday Destinations
  • Cars
    • Information on Cars
    • Traffic Violations
    • Auto Insurance
    • Trailers
    • Sport Cars
    • The Bikes
  • Entertainment
    • Entertainment Guide
    • World Music
    • Photo & Video
    • Television & Games

Tables Are Bad, Mkay?

    View: 
I recently inherited an auto insurance consumer information website (http://insurance.truxncars.com) for maintenance and ongoing development. I was pleasantly surprised by the features and the way the resources were organized in the directories, then I took a look at the source code - tables, tables, tables everywhere.



As you can imagine, with the mantra of "tables bad, css good, tables bad..." echoing from every HTML style guru I've read for the past couple of years, seeing all those nested tables made me a little glum. Then I started looking through the code, matching what I was seeing in the code with what was appearing in the generated page, and I found that it wasn't all that difficult to find my way around. Obviously, I have the benefit of looking through the php code, but even looking at the "View Page Source" output there are landmarks and helpful comments from the original designer that assist with navigation.

Now, I have seen abysmal pages where tables are tortured into achieving radically non-grid layouts using invisible spacer gifs, extensive column and row spanning, and multiple nesting with widths of the innermost cells carefully calculated to align images in the outermost table - a true Frankenstein of a table. The code I was reviewing didn't commit any of these sins; it was simply trying to present various items of information in a grid. Some of those items were themselves in the form of grids, but they are logically independent. This seems like a reasonable excuse for nested tables - are we truly justified in condemning the design because it uses them?

At this point I decided to compare the strengths and weaknesses of tables and css positioning.

1) Internet Explorer still doesn't play fair with css block dimensions, divs can nest nicely like Russian dolls in one browser but be completely misaligned in the next. Choosing a "strict" DocType helps enormously, but it's still a crapshoot.

2) CSS encourages the proliferation of "magic numbers" - one of the ultimate sins in programming. When elements are given absolute positions, naturally we have to specify the coordinates through the use of left, top, or optionally right, bottom. As the number of page elements grows, it can become a real chore to ensure that all the values are correct when changing the position of an element.

To make maintenance of a css site easier, take advantage of the centralization achievable with external css files; keep all the positioning together in a css file, and put comments in there showing how the offsets are derived. Also, take advantage of local offsets - an absolute-positioned element within an absolute-positioned parent div has offsets relative to the top-left corner of the parent. This means you can reposition the parent div, and all the elements within it are shifted to match. But I digress...

3) Tables are really bad at absolute positioning. Don't do it - if element A really must be in a specific position, exactly 219 pixels from element B, just use css. Don't fight it.

4) Tables are good at making best use of the available browser window area. They also fail gracefully. Without adding any extra code, if the visitor resizes the browser window then the table will adjust the contents as best it can, and if it can't make itself any smaller, it just stops shrinking - the visitor can scroll the page to see the rest of the table, his choice. What a table won't do is to decide to push the rightmost table cell down and against the left side of the browser window - exactly what will happen to a 'float' positioned div unless you take precautions with a container div that has a minimum-width property set.

Pause for thought... if we're nesting divs and manually adding minimum-widths to ensure that the elements appear where we designed them to be, how exactly are we adding clarity of design, compared to a table?

5) Select your favorite search engine, look for techniques to create multi-column page layouts where all the columns are the same height. The contortions you have to go through to achieve this are extraordinary - then you have to make sure your implementation works across all the major browsers. Compare the css multi-column method with a simple three-column table, which is straightforward and has always worked exactly as expected.

6) Content laid out using a table will never have unintentionally overlapping text when displayed using a screen resolution or window size not anticipated by the designer. Sadly, this is an increasingly common problem on a wide variety of websites and seems to be driven entirely by the perceived need to position everything explicitly using css.

It's plain to see that both css positioning and table layout have their place. CSS has finer control, and should be the method of choice. It allows powerful centralized control across a whole website from a single file, and can lead to cleaner and faster-loading pages. On the other hand, tables are excellent at adaptive layouts free from unexpected side-effects. If used as intended - primarily without arcane inherited positioning artifacts where the contents of an inner cell performs critical positioning of an outer element - then tables can form a robust, low-maintenance framework for your page.
More Articles from
Computer Hardware Guide Pg477
Creating Custom Controls C#
Data Recovery Hard Drives
Facts About Dogs For Kids
Free File Recovery Tools
Islam The Fastest Growing Religion
Lebron James Final Shot
The Best Desktop Computer
The Five Major Religions
The History Of Games
Types Of Usb Cables
Virtual Dedicated Server Windows
The First Processor That Supports 256Terabytes of RAM
The Fiercest Microprocessors
The fight against DNS attacks continues
The Forum Dedicated to the Wii
The Foundation For Online Success
The Feel Of The Web
The Forum Lifecycle And Those Who Monitor Them
The Facts Of Colocation Hosting
The First Ever Tots100 Index of British Parenting Blogs and Bloggers
» More on
Computer Hardware Guide
  • Related Articles
  • Author
  • Most Popular
Peter Maloy has sinced written about articles on various topics from Computers and The Internet. Peter Maloy - applying software engineering techniques to website design. My current work in progress is http://insurance.truxncars.com. Peter Maloy's top article . Bookmark Peter Maloy to your Favourites.
Catch 22 Book Review
Sometimes this will mean having to face failure and to start over but teenagers will gain practical knowledge from undertaking challenges and build psychological strength from the mere attempt at sol...
 
A Guide to Business | Guide to Technology | Guide to Women | Guide to Health | Family Guide to | Travel & Vacations | Information on Cars

EditorialToday IT Hardwares has 2 sub sections. Such as Computer Guide and Hardware. With over 20,000 authors and writers, we are a well known online resource and editorial services site in United Kingdom, Canada & America . Here, we cover all the major topics from self help guide to A Guide to Business, Guide to Finance, Ideas for Marketing, Legal Guide, Lettre De Motivation, Guide to Insurance, Guide to Health, Guide to Medical, Military Service, Guide to Women, Pet Guide, Politics and Policy , Guide to Technology, The Travel Guide, Information on Cars, Entertainment Guide, Family Guide to, Hobbies and Interests, Quality Home Improvement, Arts & Humanities and many more.
About Editorial Today | Contact Us | Terms of Use | Submit an Article | Our Authors