FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Divs and Tables





ChunkyBustout
Hello,

Could someone tell me if using tables instead of divs would help in displaying my site in IE and Firefox? Currently, I'm using divs and it's exactly like I want it. But in IE (and Opera) some of the blocks are askew. I know it's hurting the potential return traffic to my site but I don't want to change it unless it would definately help.

My page is at http://www.chunkybustout.com.

If you're using Firefox, you won't see what I mean but you're more than welcome to view it.

Thanks.
Naif
Hi. I can see your problem. Using tables instead of div layers is a better choice, atleast according to me. I too am facing problems with the <div> tag but in my case, its the otherway around. I am having problems viewing it under firefox. I guess the <div> tag isnt cross browser friendly(or maybe my knowledge of its proper usage is limited Smile).
Marston
Ok, what you might want to do is have different stylesheets for different browsers... You're going to have to put the reams of CSS in the <head> tags of your documents into one central file and then copy that file. Rename the second file. Then place this bit of code in the same spot that you had all of your CSS. In the example below, I've named the two files as msie.css for IE, and mozilla.css for everything else. You might have to modify it a bit to work the way you want...
Code:
<script type="text/javascript">
<!--
var browserName=navigator.appName;
// Browser Specific CSS Output
if (browserName=="Microsoft Internet Explorer")
{
document.write('<link rel="stylesheet" href="msie.css" type="text/css">')
}
else
{
document.write('<link rel="stylesheet" href="mozilla.css" type="text/css">')
}
// -->
</script>
Hope this helps. Confused
ChunkyBustout
Thanks, Marston. I'll give it a whirl this weekend sometime.
Marston
Hey, any time. Very Happy
mano
well, tables are for structured information not for webpage layout - and that includes table tag in html. divs are much more flexible and accesible, you just need to invest some time to learn how to use them properly.
riv_
I would avoid using tables AND browser-specific style sheets wherever you can. But I'm anal. Do what works for you.
IE has some weird bugs. It adds up padding and margins and borders and contents totally differently than the other browsers due (IE sucks... it's totally not standards compliant!)

http://www.brainjar.com/css/positioning/default.asp is the first place I go when something doesn't do what I expected it too.

Otherwise, there's some good articles about CSS positioning, browser bugs and hacks at http://www.positioniseverything.net/.
Hopefully that will help.
Maybe I'll take a look too. (Like that's any help!) Confused
Good luck!
Related topics
Okay, I'm done trying to use CSS for layout.
What do you use to make your page layout?
CSS OR TABLES
I cant install php chat tables nor set up diffrent subdomain
Creating a layout complete with css
E-Lyrics
CSS Help needed : Table emulation with divs
Resolution
Page columns: tables or no tables?
tables or div ?
Free Web Templates...
Why don't people like tables?
Tables to Divs with rowspans
Stretched Background Image to 100%: help
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.