Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Design question

 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Recently I've adopted the use of <DIV>, replacing my old, rather ugly habit of nesting tables, upon tables, upon tables. It seems the pages I code using <DIV> exclusively, are more likely to be compatible across browsers. Anyone have any opinions? Do you rely more on stylesheets than traditional HTML? Are there any drawbacks to using <DIV>?
Thanks for your opinions,
WS
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Divs and spans are the only way to go. A table was designed to display tabular information.
The best thing to do is just CSS you way throgh the page. It is so much easier to update a site that is done with CSS!
The drawbacks are it takes longer to get it to look right, but the positive side is faster loading times!
You may even want to dig into XHTML to make your pages even more compliant!
If you ever hhave trouble getting something looking right just ask it in the forum!
Eric
 
Winston Smith
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Eric. I've been a barfly in the JSP forum for the past few months, schmoozing my way around JSP code and not really taking time to explore the other gigs going on around the Ranch. I believe I've found a new watering hole. Thanks again,
WS
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My opinion: DIVs stink for layout. I've given up on using CSS to completely lay out pages. Too many browser inconsistencies for my taste. I use tables to layout things, and all the regular CSS constructs to format, etc. My opinion. Maybe in a couple years before everybody gets their act together I'll be able to do pure CSS, but until then, it's only wishful thinking for me.
 
Sheriff
Posts: 67592
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

DIVs stink for layout.


Correction: IE stinks for layout. If IE would correctly support the bottom and right style rules, then using tables for anything other than, well, tables would be a thing of the past. (But heck, why improve a browser that's already "won" the browsers war? Isn't 'almost' good enough?)
I use CSS for layout whenever I can. On those occasions when IE bites me in the derriere, I usually use server-side browser detection to deliver a non-compliant but IE-safe version to IE.
 
Winston Smith
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, from what I've seen, if done right, DIVs provide much cleaner code, and also greater compatibility among browsers. I've coded some large pages using nested tables, and when the boss comes to your desk and asks you why it doesn't work in Netscape, well, what can you say...just make them use IE? No, you've got to go in there with a shovel, well, make that a front-end loader, dig through the code and find out why Netscape and the other browsers don't like the table formats. It was a nightmare, and that's the reason I've been looking into DIVs. In my opinion, tables are just too much code and too inconsistent across browsers.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is my 2 cents:
I started using DIVs sometime back because I wanted to clearer code and wanted to avoid the tables inside tables inside tables inside tables. I worked great for many things I did but there was one particular thing that bugged me (where I had to resort going back to tables). The situation was this:
- I wanted to creating a simple two column layout (using a DIV for each column)
- The left column contained a menu.
- The right column contained the content of the page.
- The left column had a fixed colour (say yellow) and the right column was plain white.
The problem occured when the right column contained more content that what could fit into the browser window. For some strange reason the left column didn't continue all the way down but only to what could fit into the browser window.
Anyways - those are things I'm sure can be dealt with if you are a CSS shark - but until things like these become a bit more standard I will stick to using tables.
Allan
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bear Bibeault:

Correction: IE stinks for layout. If IE would correctly support the bottom and right style rules, then using tables for anything other than, well, tables would be a thing of the past. (But heck, why improve a browser that's already "won" the browsers war? Isn't 'almost' good enough?)
I use CSS for layout whenever I can. On those occasions when IE bites me in the derriere, I usually use server-side browser detection to deliver a non-compliant but IE-safe version to IE.


weird... IE is THE most compliant of all browsers out there... There are some quircks but not nearly as much as with the competition.
I guess it may be your understanding of the meaning of the classes rather than their implementation in IE that is at fault here.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeroen Wenting:

weird... IE is THE most compliant of all browsers out there... There are some quircks but not nearly as much as with the competition.
I guess it may be your understanding of the meaning of the classes rather than their implementation in IE that is at fault here.


LOL...IE is not the most compliant, there are people that are writing stylesheets to force it to act like like it should. The most compiant are the Mozzila browsers...
Eric
 
Winston Smith
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my opinion, IE is just another mass-produced, conveniently-packaged, easy-to-handle piece of McSoftware that certainly serves the common good (just like those $.50 cheeseburgers), but when it comes to looking at it from a higher perspective, such as the developer's point of view, IE is sloppy, and sucks you into that M$ snare just like all their other pieces of point-and-click software -- sure it's easy to code, but once you leave MicrosoftLand, you're inevitably going to lose even more hair when you find out your software doesn't play well with others.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check the standards docs, then check browser compliance.
You'll find IE in compliance with a larger part of the CSS1, CSS2, ECMAScript 1.5, XHTML, and other standards than any other browser on the market.
If that makes it easier to code against IE, is that a good thing or (as you claim) a bad thing?
You sound like just another "It's Microsoft so it must be bad" kiddie.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then why are people going these extremes?
http://dean.edwards.name/IE7/intro/
 
Bear Bibeault
Sheriff
Posts: 67592
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

weird... IE is THE most compliant of all browsers out there...


Far, far from it. You've been standing too close to the Microsoft propoganda machine.
If they can't even get the bottom and right CSS rules correct, what's the point of looking further? (and if you do, the the list gets longer and longer and longer).
And let's not even start talking about event handling...
 
Winston Smith
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You sound like just another "It's Microsoft so it must be bad" kiddie.


I humbly accept the fact that I'm simply a novice, but, regardless, I have been in the trenches long enough to form an educated opinion on certain things, an opinion which is hardly the result of some anti-Microsoft bandwagon, but more the result of passing conversations, idle talk, and bar room arguments with those who have much more horsepower than I. I certainly respect the fact that Microsoft developers may be some of the brightest in the field, however, the company has always had an agenda -- to conquer the marketplace. They do so by marketing to the "point-and-clicker", and they're marketing their McSoftware fast enough and good enough to send the majority of the population to the fat farm.
Sure, I do use Microsoft products, and those I use aren't bad at all, but what I don't do is play ball and subscribe to the mass-production line mentality of feeding inferior software to the starving masses with the sole purpose of marketplace dominance.
WS
 
Won't you be my neighbor? - Fred Rogers. tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic