Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DIV vs Goold ol' Tables??

Status
Not open for further replies.

FederalProgrammer

Programmer
Jul 2, 2003
318
0
0
CA
Well, I hope this is not like me asking if C# is better than VB.NET ('cause I know this is a subject that boils up a lot of programmers!!)

We have to maintain a website w/ a flash header, written in PHP-MySQL and it uses CSS style sheets.
The problem is my php programmer, is really complaining about DIVs and he hates them... He says it's a maintenance nightmare;

I tried it myself too and I really hated it, but that's probably because I don't know how to use DIVs!

Also, Macintosh users cannot see this website in its normal form (as it appears on PC). Both PC users and Mac users use Internet Explorer... however, MAC users see the site with all the boxes out of place!

1) Is this due to the usage of DIVs...
2) Is it better if get rid of the DIVs and turn the site into a normal HTML looking page?

cheers!


---------------
 
IMHO there are multiple things to consider:

1. Presentation and logic should be completely separate. Let the designers do their work and the coders the coding. Abstract code that provides information and inserts it into templates is the most versatile way of doing that.
2. Tables where tables belong (like tabular data).
3. <div> where divs belong, such as sectioning pages into areas etc.
4. I believe that <div> with positioning is not yet ready for prime time. Not that the CSS standard is not advanced and clear, it is the support from the browser manaufacturers that lacks consitency.

A healthy compromise seems appropriate.
CSS is great as far as styling goes, however, I would keep away from the positioning as of yet in order to cover the widest base of browsers.

 
Thanx for dealing w/ my question in a professional manner! (I was expecting a lot worse!)

what do you think about Mac not being able to display the page properly then (even though, mac users are using internet explorer?) Would you say it may be inherting the problem from the same logic (Positioning in CSS?)

cheers!



---------------
 
IE on the Mac is stuck at I believe Version 5.5 - it is and has been a major headache for Web developers.
With the new OSX however I would recommend to concentrate more on compatibility with Safari and the Mozilla based browsers such as Firefox.
Have a look at your web stats and see how many (few) people use IE on the Mac.
Positioning and inability to interpret it correctly is certainly the culprit.
 
Mac IE is stuck at Version 5.23 and reached end of life in 2003. The vendor no longer supports it.


Although it was advanced in 2000 when it came out, it is time to upgrade. The Tasman rendering engine is not supported either on the Mac in favor of Opera's engine.

Netscape's last version for the PPC was at 7.02 and has better XHTML support.

There is a mozilla port for the Mozilla browser for PPC but I think it's last release was 1.4.

 
Also keep the DIV's with XHTML support. Much easier to maintain in the long run.

Your programmer most likely needs some rudimentary CSS skills. Have him look at for inspiration.
 
hmmmmm,
Great; Now, if I want for my mac users to view my website, what should I do...

If I get one of my website designers to change the layout from the <DIV>s to a normal HTML page w/ tables, will that do the magic or will I end up wasting my money?

I mean, in long run I'll probably save money, since, right now, the smallest thing we want to add to this website, we go through some major headaches!!!! is this due to lack of exprience or is this usually the case w/ these "DIV" related stuff?



---------------
 
I don't think that using divs and positioning with css should be avoided. But you can best judge this, since you know how complicated (design wise) your page actually is. I have seen (and created) pages with css positioning that worked out of the box (without additional tweaking) in all the modern browsers -- and that included IE for Mac. So I think that you first need better design developers. Because CSS is so powerful, it allows creating same effects through different techniques. Of those techniques some are more clumsy than others and result in improper presentation in various browsers. Unless your design is overly complex, you should have no problems maintaining it via css and divs for all browsers.
 
I'll give you an example:

Here's a sample of what's on the style sheet
Code:
#preferredbox {
	position: absolute;
	top: 219px;
	left: 510px;
	background-image: url('../images/preferredbg.jpg');
	width: 263px;
	height: 285px;
	padding: 58px 0 0 11px;
}

following uses the style sheet with no problem:
Code:
<div id='preferredbox'>
		<span class='preferredbox_title'>
			<img src ='images/preferredbrokers.gif' alt='Preferred Brokers' />
		</span>
	</div>

but as soon as we put this banner in this area, all hell breaks loose:
Code:
			<a href='[URL unfurl="true"]http://www.SpeedTrader.com?refer=hessian'><img[/URL] src='[URL unfurl="true"]http://www.SpeedTrader.com/img/spee.gif'[/URL] width='468' height='60' border='0' alt='Offers FREE streaming real-time Level II quotes, intra-day charting, point and click trading, fast confirmations, and low commissions. Trade with SPEED!'></a>




---------------
 
We're falling out of the scope of this forum. To continue, we should go to XHTML & CSS forum. However, I will tell you that using absolute positioning is (if possible) best avoided. Without seeing all your code, it is impossible to tell if it could be avoided in this instance, though practice says that in 95% it is. We can help you tweak your website to work better in XHTML & CSS forum, but we will not rewrite all the code for you. If you are the designer, or have a designer who's willing to rewrite the code to be more cross-platform compatible, we will be happy to help.
 
I might suggest the use of the Smarty library ( to ensure web designer and programmer tasks are kept seperate. That way, things are easier for both parties, and code changes in HTML or code changes in PHP do not affect anyone else, and do not require reprogramming of the whole application.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top