View Full Version : Tables vs. CSS for layout
Craig
Thu., Jun. 2, 2005, 7:19 am
I typically employ 800x600 using table structure. It assists in maintaining continuity and positioning so every page appears the same regardless of resolution.
generalhavok
Thu., Jun. 2, 2005, 7:46 am
I've stopped using tables for virtually everything but tabular data...for two reasons:
1. When I design a site with a CSS-controlled layout, I can change the layout by editing only my stylesheet. I don't have to redesign the entire site by changing every single HTML file. I've done this a number of times now...a website created this way is very, very flexible. As an example, I added an extra column to my church's site without changing anything but my stylesheet. Change one file, change the whole site! Okay, I had to add the div to my HTML...but I could do that with a search and replace program.
2. One of the major criteria that search engines use to determine relevance is "code to content ratio". They compare the number of characters in each page, calculating the amount that's used for layout vs the amount that contains actual information. Removing as much code as possible means that every page is more relevant, automatically. Sometimes the results are stunning...my personal site (www.godwords.org) was once listed at #9 on Yahoo (out of something like 860,000,000 pages) for the search phrase "contact me". I can only attribute that to clean, standards-compliant code and to having a website with over 100 pages.
Tables are wonderful...but I find them too limiting these days. Layouts can be controlled down to the last pixel without them, as can be seen in my latest project. It's a mockup for a local bookstore: http://www.straightstreetdesign.com/clients/logoslittleton/. No tables there...only 15 floated divs!
David Gillaspey
Sat., Jun. 4, 2005, 11:29 pm
Layouts can be controlled down to the last pixel without them, as can be seen in my latest project. Unless your visitor views the page in a non-CSS compliant browser, such as Mac I.E. 5.2. Then it completely falls apart. However, that's an increasingly small (from an already very small) percentage of users, because of the growing popularity of Firefox.
The advantage of tables is they work in all browsers. But I'm not writing to argue for continued use of tables.
My site (Great Church Websites, which hosts this forum) is built with a so-called "liquid design" technique ? table-based ? in which the content of the page (including other tables, if any) is enclosed in the sole cell of a single-cell table set to a width of 100%. The enclosing cell is centered horizontally and set to a width of something like 75%. This ensures the content of the page is always centered horizontally, regardless of how wide the user makes his or her browser window.
Now I see you've accomplished the same thing using CSS on the Logos bookstore layout. Would you mind sharing some of the basic CSS techniques I would need to use to convert the layout of my site to CSS-controlled? (Specifically, techniques to maintain the liquid design that I've achieved through tables and you've achieved through CSS. I'm not looking for a treatise on CSS in general, because I already have a basic understanding of CSS.)
Thanks!
Sincerely,
David Gillaspey
President
Great Church Websites
generalhavok
Mon., Jun. 6, 2005, 9:26 am
David:
You're correct that non-standards browsers won't render a CSS-based layout properly. However, there are other considerations:
1. Most of those browsers are also buggy in terms of how they render tables as well...notably NN 4, which won't (if memory serves) render a table, or any of the nested elements inside of it, until it has the height and width of each cell and element. This turns into a nightmare for modem users, since the page doesn't render anything at all until it's all loaded. Newer, more standards-compliant browsers are free, after all...and there's no reason to limit your design possibilities on their behalf. CSS1 has been a standard since around 1999. Most who use older browsers could use newer if they chose...and one argument says that designers who triple their work to make sites work perfectly for legacy browsers are simply prolonging their own agony.
2. If you correctly refer to your stylesheet, non-CSS browsers won't get broken sites...they'll get unstyled sites. If the point is to get the message out, then that's preferable. Nothing's wrong with H1s and unordered lists. Back in 1996 or 1997, that's what most of the web looked like!
3. If someone's worried about losing their visitors who use non-CSS browsers, they can simply do a statistical analysis of their visitors. Those who have (my opinion, based on a lot of reading) 10% who can't see their CSS should indeed work out a hybrid solution. In 2005 my personal site has had 22947 visitors. Of those, only about 5% use "legacy" browsers. How many of GCW's visitors use a non-CSS browser?
4. Cost-Benefit: Using a CSS layout with includes makes life for the designer/webmaster so much simpler! Imagine having a table-based site with no CSS and hundreds of pages...every time you want to make a change you must change EVERY AFFECTED PAGE. I've done this many, many times...my personal site has 250+ pages and it's a pain to change every page. The site becomes inconsistent and buggy over time due to simple entropy. Using CSS and include files for navigation, etc I can change two or three text files to make my site look completely different. Adding the extra column to my church site would have taken me an entire day instead of a couple of hours, had I been using a table layout. There's no simple way to do a global search and replace on a table layout, so I would've changed every table by hand. On a large site, that could be several days' work! My business caters generally to churches and not-for-profits...were I to work "old-school" I'd have to charge each group more and serve fewer in the long run.
So, here's how usually I create a website:
Full Page div
Header div
Content Container div(for both nav and content)
Nav div
Content div
Footer div
In the HTML code, the header div is generally empty, and the nav divs only have an include. Almost all pictures are CSS backgrounds (so that I can change them easily). Anyone who's used an extensive navigation scheme can agree with the wisdom of using a single text file for the nav links and using a snip of code to include them when the page renders. Change one page, change the whole site.
WHEN TO USE TABLES:
1. To display tabular data.
2. If you don't yet know enough to NOT use tables.
3. When using a templated content management system. For those who do know enough to create great sites, I'd recommend playing with your templates as well...there's no reason that templates should be bloated with tr's and td's and the like. Making your own template page isn't much harder than making a site from scratch.
Next I'll address your question about conversion...
generalhavok
Mon., Jun. 6, 2005, 10:31 am
Now I see you've accomplished the same thing using CSS on the Logos bookstore layout. Would you mind sharing some of the basic CSS techniques I would need to use to convert the layout of my site to CSS-controlled? (Specifically, techniques to maintain the liquid design that I've achieved through tables and you've achieved through CSS. I'm not looking for a treatise on CSS in general, because I already have a basic understanding of CSS.)
It's going to take some work. Moving from tables to divs requires an 'up front' cost in terms of time. Essentially, you'll be changing the code for every page. If you're thinking of a redesign anyway, that's a good time to do it. Here's how I changed my personal site...keep in mind that it's a static site with a limited number of pages (250ish):
1. I created a "brand new" site structure from scratch. In my code I placed comments to show where content will go: <!-- CONTENT GOES HERE -->
2. I opened my old pages and cut the content out...then pasted them into my content div.
3. I saved my new pages and uploaded them.
Don't get me wrong...that took a weekend. At the same time, I converted to XHTML, so all <br> tags became <br /> and all images had to be closed the same way. I also cleaned up my markup. Even if you use tables, you should also use CSS. Where I used to have <font face="red"><font face="arial"><font size="12pt">Headline</font></font></font> I know have <h1>Headline</h1>. My style sheet now says h1 { font: regular 12pt arial; }. That's a LOT of code I got to throw away!
If you go to http://www.godwords.org/ you'll see a simple site that has no tables. There are generally only three graphics, as well: a header, a footer, and a repeating content background. These are in the CSS, so there's no need to have a single <img src> in my HTML.
Also: I don't use a single browser-specific code. That's right: NO HACKS. My code is written so that the same code works for IE and Firefox and Opera. The *very* minor display differences might amount to a single pixel's difference, if that. NO ONE can make a site look exactly the same for everyone...so you're really only getting "as close as you can" anyway.
NOW: GCW. The main page is pretty simple in structure.
1. Header, including horizontal navigation.
2. Left column (more navigation and info).
3. Right column (content, including footer).
You don't get much simpler than that. Were you to rewrite the structure, it might look like this:
<div id="fullpagecontainer">
<div id="header"><include nav snip></div>
<div id="nav"><include info snip></div>
<div id="content"><!-- CONTENT GOES HERE --></div>
<div id="footer"><include footer snip></div>
</div>
You'd put the header graphic in your CSS.
You'd put your navigation in a single text file and include it.
You'd put your left column in a single text file and include it.
You'd paste your content in the content div.
You'd put your footer in a single text file and include it.
That's it for the main page. The church database content could be done with a little more work...three floated divs would do the trick, or you could use a simple three-cell table for each church's data. You could potentially use includes there as well, dynamically inserting them with php. The problem there is how to make a liquid layout. Currently your screen wraps horizontally at 930px, so I wouldn't think that's a huge consideration at the moment...it's not liquid now.
Imagine how much lighter your code would be if you could replace
<font face="red"><font face="arial"><font size="12pt">Headline</font></font></font>
with
<h1>Headline</h1>
on a site with a thousand pages! Not only is it easier to manage, your search engine ranking will skyrocket. Here's what standards-compliant CSS layouts has done for me: I can make a brand new (simple) website from scratch, including graphics, in 3-4 hours. I can completely redesign that site, including graphics, in about 2-3 hours. It will be simple to understand, simple to update, and my search engine ranking will be in the double digits (generally) instead of being virtually non-existent. Here's how ridiculously easy it is to accomplish a great search engine rating this way:
http://www.columbinehills.org/ used to have a "singles" page. On it were four words: "Come join the fun!". Our singles ministry wasn't doing much, obviously. However: searching Yahoo for "singles ministries" showed us at number 18 of 850,000+ pages. Other phrases: for "colorado singles church" we were #8. For "church singles ministry" we were #13. How about this one: for "colorado singles" (presumably a BIG dating phrase) we were #15.
Using CSS layouts is almost like magic. How else can one explain why my site was #9 of 860,000,000 for the search phrase "Contact Me"?
For the forums you would need to create your own theme. I'm in the process of studying that at the moment...and from what I understand, you'll simply create a new index.php for each block. When your page is rendered, the blocks are assembled based on your instructions...if the site can show table-based HTML, it can also show CSS-based HTML. I haven't seen any forums that do this, but I've seen many CMS sites that do. I presume that the bulk of forums "aren't worth the work" or are simply run by folks who don't mind being all but invisible to the search engines. I'm not trying to be code snob, David...it's just that the amount of work involved in using CSS layouts and semantic markup is so miniscule when compared to tables, and that the benefits so greatly outweigh the negatives, that I can't help but sound like it. Do I use tables? Sure I do...but not as a design crutch. I use them where they make sense, and I have other (better) options when they don't. Is it hard to learn new technologies? Yes! I had trouble learning tables, and I had trouble learning about CSS and semantic code.
If you or anyone else have specific questions about this subject, feel free to write. There are a ton of large commerce sites that have pages that explain how their updated their sites from tables to standards-compliant CSS...search for "converted site tables" and see a lot of them.
Have a good one!
PS: I *LOVE* the fact that you've named your cookies "Jesus Loves You" and "Jesus Is Lord". That's awesome!
David Gillaspey
Sat., Jun. 11, 2005, 5:38 pm
Hi General,
Thanks for generously taking time to reply to my post with a lot of information about using CSS. It looks like converting the layout of my site to CSS-based wouldn't be too hard.
However, you appear to have assumed that people such as myself who use tables for site layout don't use includes, templates, or CSS. In fact, I use all three, extensively. I just don't use CSS for layout.
This forum, which uses a proprietary solution, vBulletin (http://www.vbulletin.com), I don't plan on touching. Way too much code I don't understand. (Formerly I used phpBB2, the code for which I halfway understood.)
When I put this example code that you provided in a test page:
<div id="fullpagecontainer">
<div id="header">include nav snip</div>
<div id="nav">include info snip</div>
<div id="content">!-- CONTENT GOES HERE --</div>
<div id="footer">include footer snip</div>
</div>
(deliberately leaving out the left and right angle brackets for the content between div tags so they'd actually appear in the browser)
all I get is this
http://www.greatchurchwebsites.org/art/css_test.jpg
so I think I need more detailed instructions from you, about positioning page elements with CSS.
2. If you correctly refer to your stylesheet, non-CSS browsers won't get broken sites...they'll get unstyledYour example site, when viewed in I.E. 5.2 on the Mac, isn't "unstyled". It's broken -- it displays badly.
How many of GCW's visitors use a non-CSS browser?I do. And by the way, I.E. 5.2 on the Macintosh is not a "non-CSS" browser. It's a browser that is not fully CSS-compliant. I use CSS extensively on my site. It displays fine in I.E. on the Mac.
All I'm saying is that a simple horizontal arrangement of elements, e.g., navigational links across the top of a page, ought to display just fine in all browsers. What often happens with links arranged horizontally using CSS rather than a table (a simple table at that) is that instead of appearing horizontally in I.E. 5.2 on the Macintosh (and presumably in other less-than-completely or totally non-CSS-compliant browsers, also), they display as a vertical stack.
I *LOVE* the fact that you've named your cookies "Jesus Loves You" and "Jesus Is Lord". That's awesomeIt's psychological. Who's going to delete cookies named that way?
Anyway, thanks again for the detailed information you provided. The information you provided benefits not just me but all members and visitors to this forum.
Sincerely,
David Gillaspey
President
Great Church Websites
generalhavok
Sat., Jun. 11, 2005, 10:22 pm
Hi General,
Thanks for generously taking time to reply to my post with a lot of information about using CSS. It looks like converting the layout of my site to CSS-based wouldn't be too hard.You're quite welcome!
When I put this example code that you provided in a test page:Sorry, David...that wasn't example code, just a descriptive explanation of how uncomplicated the page code is. What you saw is EXACTLY what was coded, by the way. You have several divs, and the words you saw are the words that you should have seen. You'd simply replace the words inside the divs with the appropriate content.
<div id="fullpagecontainer">
<div id="header">This is the place where your header content goes.</div>
<div id="nav">This is the place where your navigation goes.</div>
<div id="content">This is the place where your content goes.</div>
<div id="footer">This is the place where your footer goes.</div>
</div>
so I think I need more detailed instructions from you, about positioning page elements with CSS.Then, in your separate style sheet, you'd have things like this:
#fullpagecontainer {
margin: 0px;
padding: 0px;
width: 780px;
height: 100%;
background-image: url(/images/background.gif);
background-repeat: repeat-y; }
...where you're styling each div. I recommend running yourself through the W3C Schools tutorial on CSS if you're unsure about positioning. It's really pretty well-done. Then, when you're coding, test in more than one browser and ask questions when you run into weirdness...because you will.
And by the way, I.E. 5.2 on the Macintosh is not a "non-CSS" browser. It's a browser that is not fully CSS-compliant. Question: if it's not fully CSS-compliant, why do you use it? I'm curious. I wouldn't use Netscrape 4 or IE 5x for Windows...why choose to use a browser that doesn't give you what you're looking for? I'm not specifically a Mac guy, so maybe I'm missing something.
All I'm saying is that a simple horizontal arrangement of elements, e.g., navigational links across the top of a page, ought to display just fine in all browsers.You're absolutely correct! Unfortunately, no two browsers are alike. Firefox uses the Netscape Gecko engine, for example...but it differs from Netscape in many ways. The point is to code in a way that works as closely as possible for all browsers. If you're concerned about IE 5.2 for Mac users, you can link to two different stylesheets...one for non-compliant browsers, and one that shows your sites exactly as you'd like. Non-compliant folks will get a good site, while the rest of us get a great site.
What often happens with links arranged horizontally using CSS...they display as a vertical stack.You can find some VERY excellent information here
http://accessat.c-net.us/articles/convert_p3.html. This site was converted from tables and javascript rollovers to CSS...and at the top of the article you have links to the before and after. There's ALMOST no difference. He even explains a bit about IE/Mac and floated elements. See if your browser displays his site properly...
David Gillaspey
Sat., Jun. 18, 2005, 12:07 pm
Hi General,
Thanks again for taking time to provide a detailed response to my questions.
Then, in your separate style sheet, you'd have things like thisYeah, but I don't see any code for "center". I want my site to be horizontally centered in the browser, regardless of how wide the user makes his or her browser. That was what I was demonstrating with my example screen shot: the fact that things weren't centered, but were flush left. But I think it's easy to accomplish.
Question: if it's [I.E. 5.2 on the Mac] not fully CSS-compliant, why do you use itBut 99% of all websites render fine in it. The only thing that doesn't work is positioning of elements via CSS, and I can't say that that's always a problem ? I just notice it when it doesn't work.
Actually, I use Firefox all the time. I do my job hunting in Firefox, since I can quickly switch from job website to job website (and cnn.com) by selecting different tabs.
Unfortunately, Firefox is a bit quirky on the Mac (although maybe I need to upgrade). For example, the Page Down and Page Up buttons regularly refuse to work, forcing me to use the mouse to move the scroll bar up and down if I want to scroll through a webpage. That's really annoying to me.
There are other quirks that bother me, but I'll spare you the details. The point is, I.E. 5.2 for the Mac is quirk-free.
Morever, you need to know that there are many sites I visit using Firefox on the Mac in which the type is about 6 points in appearance ? totally unreadable. It's easy for me to enlarge the type (command key plus the + key), but then the design begins to fall apart.
I mention this to illustrate the fact that just because a web designer has created a presumably fully CSS-compliant website, doesn't mean it looks nice when I view it on my Mac in a fully CSS-compliant browser.
If you're concerned about IE 5.2 for Mac users, I'm not, actually. The market share is too small. That's why I'm not pushing my argument too far. But I'm enjoying the conversation.
You can find some VERY excellent information here (http://accessat.c-net.us/articles/convert_p3.html)That looks like a really useful site. Thanks for mentioning it!
Sincerely,
David Gillaspey
President
Great Church Websites
generalhavok
Mon., Jun. 20, 2005, 2:32 pm
Hi General...thanks again for taking time to provide a detailed response to my questions.
No problem, David...that's why we're all here, right?
Yeah, but I don't see any code for "center". I want my site to be horizontally centered in the browser, regardless of how wide the user makes his or her browser.
Simple: in your CSS, your containing div's margin should look like this...
#container { margin: 0px auto; }
This will make your top and bottom margins 0 pixels, and will automatically adjust the left and right margins to center the div.
But 99% of all websites render fine in it. The only thing that doesn't work is positioning of elements via CSS...
That 99% might not be accurate, and will change over time...and you might not realize how it's affecting your 'web experience'. Sites that are well-designed degrade gracefully...that is, they look okay in all browsers. As a web designer and long-time web user, I'd much prefer seeing each website as the designer intended rather than a simplified version. CSS1 has been the standard since 1999...if your browser isn't fully compliant, I'd find one that is.
I mention this to illustrate the fact that just because a web designer has created a presumably fully CSS-compliant website, doesn't mean it looks nice when I view it on my Mac in a fully CSS-compliant browser.
You're quite right...but the original question seemed to be about YOUR website. Strictly speaking, CSS can do virtually everthing that needs to be done. If you need to do something that CSS can't do, you probably already know enough about web design to know it...if you aren't convinced, a quick browse of the CSS Zen Garden (http://www.csszengarden.com/) should do the trick. Every design example there has the EXACT same HTML code, but different style sheets. If you aren't impressed with the design possibilities there, I'll be surprised. Make sure you view it in MacIE5 so that you have a good idea of what IS truly possible.
Have a great day!
David Gillaspey
Sat., Jun. 25, 2005, 11:31 am
Hi generalhavok,
Thanks for the information. I'll be working today (Saturday) on replacing tables with CSS in my site (for layout control), at least on test pages. That won't be too hard, since I only use a couple of simple tables for my layout, and make extensive use of includes.
Sincerely,
David Gillaspey
President
Great Church Websites
David Gillaspey
Mon., Jun. 27, 2005, 4:49 pm
Hi generalhavok,
I'm back to report the results of my weekend efforts.
First, this screenshot
http://www.greatchurchwebsites.org/art/css_test2.jpg
demonstrates that specifying a margin of "auto," as you suggested, does work for centering things horizontally. (I am referring to the white block and all that it contains.) Thanks!
The code is here:
******************************
<head>
<style type="text/css">
<!--
.fullpageContainer {
margin: 0px auto;
background-color: lightgreen;
}
.contentsContainer {
width:500px;
margin: 0px auto;
padding:12px;
background-color: white;
}
.header {
background-color: yellow;
}
.content1 {
background-color: #FFE099;
width:150px;
}
.content2 {
background-color: #FFC133;
width:200px;
}
.content3 {
background-color: #C2D8F2;
width:150px;
}
.footer {
background-color: #FF7733;
}
-->
</style>
</head>
<body>
<div class="fullpageContainer">Full width of browser
<div class="contentsContainer">Actual contents, centered in browser
<div class="header">Header (full width of actual contents)</div>
<div id="WhatFollowsShouldBeARow">
<div class="content1">Lefthand column</div>
<div class="content2">Middle column</div>
<div class="content3">Righthand column</div>
</div>
<div class="footer">Footer (full width of actual contents)</div>
</div>
</div>
******************************
(By the way, the "id" attribute, which you used in your suggested code, didn't work for me. I find that I have to use "class" instead.)
However, the screen shot demonstrates another problem. It seems to me that closing </div> tags contain a built-in return, so to speak. So, a browser does not understand that what I want here
<div id="WhatFollowsShouldBeARow">
<div class="content1">Lefthand column</div>
<div class="content2">Middle column</div>
<div class="content3">Righthand column</div>
</div>
is three columns, arranged horizontally left to right, and so by default arranges them vertically, one after the other.
By contrast, a browser understands that
<tr>
<td>Column 1</td>
<td>Column 2</td>
<td>Column 3</td>
</tr>
is to be horizontally arranged as three columns, left to right. Further, while I can specify a specific width for one or more of the columns (in tables), if I don't, the browser will automatically spread the available horizontal space among the three columns, taking into account the width of the contents of the three cells. This is often exactly what is needed.
How, then, can a browser distinguish <div>'s that are supposed to be vertically arranged, one after the other, from those that are supposed to be horizontally arranged, when the same tag is used for both? One obvious answer is to use CSS attributes in some way to do this, but if this takes more work than using a table row and cells, I'll stick to using tables.
It appears to me, from my experiments, that one needs to use the <span> tag instead of the <div> tag if he or she wants three columns arranged left to right, like this:
<div id="WhatFollowsShouldBeARow">
<span class="content1">Lefthand column</div>
<span class="content2">Middle column</div>
<span class="content3">Righthand column</div>
</div>
which results in this test page:
http://www.greatchurchwebsites.org/art/css_test3.jpg
However, the three cells or spans are the same width, and, further, as a group are flush left. I needed them to fill out the available space, left to right, however, taking into account (as table cells do) the actual content of the spans. How can I do this? You'll see the problem in my re-working of my index page, to remove table positioning and replace it with CSS positioning:
http://www.greatchurchwebsites.org/index_css.php
(Note position of navigational links under banner.)
In general, my trial effort to replace table positioning in my home page with CSS positioning went well, although it was trickier than I thought it would be. That was the result of my deciding to get rid of certain kludges (table workarounds). As you can see, while there remains a few major challenges to overcome, the layout looks better overall because I can do some things using CSS that I can't using tables (no surprise to you, of course).
The remaining problems:
As introduced above, how to get the navigational links in the banner to be equally spaced horizontally (after the "Home" link, which needs to be and currently is centered over the lefthand column).
How to get the navigational links to be centered vertically. The "auto" trick you suggested for centering elements horizontally doesn't appear to work vertically.
Obviously, the body or text of the page should be beside the lefthand column, and not below it as is the current case. That's not happening. It should ? I just don't know why at this point.
Thanks again for your help and suggestions thus far.
(The Zen Garden site you suggested has been cited before elsewhere on this forum. It is, indeed, a very cool site.)
Sincerely,
David Gillaspey
President
Great Church Websites
flutem3
Wed., Jun. 29, 2005, 2:15 pm
David wrote:
<<It's psychological. Who's going to delete cookies named that way?>>
David,
How do you name your cookies? I have been reading the conversation between you and General Havok. I cannot say that I understand too much of it. However, eventually I will...maybe. Actually, I understand a bit more than I used to, but I don't think to my dying day I could design a website like you guys do. It is great to have the opportunity of following this discussion. Thanks!!
Carol
JackWolfgang
Sun., Jul. 3, 2005, 11:58 pm
(By the way, the "id" attribute, which you used in your suggested code, didn't work for me. I find that I have to use "class" instead.)
The "id" attribute is only supposed to be used once on a page as it replaces the <a name=""></a> construct that was more prevelant in earlier HTML. The "class" attribute can be repeated in a page. When referencing the "id" attribute tags, use a # in the style sheet, like this:
#BlogBox #content { margin-right: 200px; }
When referencing classes, use a period, like this:
.PostContent { font-size: medium }
However, the screen shot demonstrates another problem. It seems to me that closing </div> tags contain a built-in return, so to speak. So, a browser does not understand that what I want here
The div tag is a block level tag, so yes it does act more like the p tag (which is another block level tag) than the span tag (which is an inline tag). The browser understands what you told it, but you didn't tell it what you wanted. ;)
How, then, can a browser distinguish <div>'s that are supposed to be vertically arranged, one after the other, from those that are supposed to be horizontally arranged, when the same tag is used for both? One obvious answer is to use CSS attributes in some way to do this, but if this takes more work than using a table row and cells, I'll stick to using tables.
It appears to me, from my experiments, that one needs to use the <span> tag instead of the <div> tag if he or she wants three columns arranged left to right, like this:
It's better to use the div tag according to what I have seen on the design sites. Some things (mainly block level tags) won't like being wrapped in a span tag. The secret to getting the layout is the CSS.
The following CSS lines give me my left column on my site (which contains my name and my coat of arms):
#left { clear: none;
float: left;
margin-top: 0;
padding: 0;
width: 125px }
The following lines give me my main content column for my blog:
#content { margin-left: 135px;
margin-right: 0px;
padding: 0; }
#BlogBox #content { margin-right: 200px; }
Finally, here is the right column on the blog, which contains links and such:
#BlogBox #right { clear: right;
float: right;
margin-top: 100px;
width: 175px; }
I only have one major problem with this setup, which I wish I could fix. When you turn off CSS, the left column appears first, then the right, then the content. There are designs out there that degrade into the preferred content, left, right (or content, right, left), but the problem (in my opinion) is they constrain the middle column to a fixed width whereas I prefer it to be set as the remainder of the 90% of the document width that I set for on screen. It also allows me to set margins in print mode which don't waste paper with huge right and left margins.
Hope this helps.
David Gillaspey
Mon., Jul. 4, 2005, 11:53 am
Hi Jack,
Good to hear from you again. How's the job going?
Well, interestingly, I.E. 5.2 on the Mac doesn't display code wrapped in the [ CODE ][ /CODE] construct in vBulletin. I couldn't see your code. I thought that [CODE] wasn't working. But finally I had the good sense to take a look at your post with Firefox, where I could see the code.
Thanks for the info about using "ID". I looked again at my Cascading Style Sheets (by Eric Meyer) book and saw that he did discuss this early in the book. I'll have to re-read that section.
I'll study your code more later and try applying the principles to my attempted conversion of my homepage (as a test, before converting other pages on my site). It appears that "float" and "clear" are critical to the success of getting the desired effect: content always centered horizontally in the middle of the browser, which is easy to do with tables.
Sincerely,
David Gillaspey
President
Great Church Websites
JackWolfgang
Thu., Jul. 14, 2005, 11:28 pm
Good to hear from you again. How's the job going?
Going well, thank you.
Well, interestingly, I.E. 5.2 on the Mac doesn't display code wrapped in the [ CODE ][ /CODE] construct in vBulletin. I couldn't see your code. I thought that [CODE] wasn't working. But finally I had the good sense to take a look at your post with Firefox, where I could see the code.
That is interesting, but I have heard that IE 5.x for the Mac is the black sheep of browsers.
I'll study your code more later and try applying the principles to my attempted conversion of my homepage (as a test, before converting other pages on my site). It appears that "float" and "clear" are critical to the success of getting the desired effect: content always centered horizontally in the middle of the browser, which is easy to do with tables.
What I like to do is setup a working directory, copy a file and the stylesheet over, link them up, and experiment!
iamcam
Fri., Jul. 15, 2005, 2:06 am
That is interesting, but I have heard that IE 5.x for the Mac is the black sheep of browsers.
Yes, and I wish it would just die already (no offense, anyone). Seriously - it hasn't been updated in 4 years, yet people still use it - probably because many are used to using "the blue e" on windows.
David Gillaspey
Fri., Jul. 15, 2005, 11:45 am
I have heard that IE 5.x for the Mac is the black sheep of browsers.
Yes, and I wish it would just die already (no offense, anyone). Seriously - it hasn't been updated in 4 years, yet people still use it - probably because many are used to using "the blue e" on windows.Hi iamcam and Jack,
Can't speak for PC users, but I.E. 5.2 for the Mac, at least, while not fully CSS compliant, still correctly renders 99% of the websites I visit. That's why I (and other people, including PC users) still use it. It's important to understand that I.E. 5.2 for the Mac (at least) is mostly CSS compliant. The only thing I.E. 5.2 for the Mac doesn't render properly, consistently, are elements positioned through CSS. And I can't actually say that's an absolute. I only notice the websites that don't render properly in I.E. 5.2 for the Mac. I think that the one thing that absolutely does not work in I.E. 5.2 is navigational links horizontally arranged across a page via CSS + the <li> tag. (I've seen that done.)
I also use Firefox on the Mac, and mostly love it, too. As I've said elsewhere on this forum (particularly in a long-running conversation with generalhavok), its tab feature is very helpful to me in my job search. The tabs allow me to keep many different job sites available at once.
But I have two problems with Firefox for the Mac: 1) the Page Down and Page Up regularly stop working. That's very annoying to me. I just downloaded v1.05 and the problem still exists. 2) On some of the sites I visit, e.g., monster.com, the type (text) has been spec'd too small so I have to enlarge it. Sure, that's easy to do in Firefox and other browsers (command key plus "+"), but eventually, as one increases the point size of type, the layout of a webpage begins to fall apart.
The problem here is website developers who work only Windows and never bother to check their sites on a Macintosh. As you probably know, fonts on Windows appear 20% bigger than the same font and font size on the Mac. Developers who try to pack as much information on a page as possible by reducing the point size of type to a just-acceptable level on Windows cause Mac users problems because that just-acceptable point size, on Windows, appears too small to be read on the Mac. (I don't really have this problem with I.E. on the Mac.)
I continue to use I.E. 5.2 for the Mac (as well as Firefox), therefore, because it functions perfectly and as for rendering of pages, only has problems with 1% of sites.
With regard to people adopting new technologies such as Firefox, it's important to understand this is typically done in stages by different types of people. For more information on the theory (specifically as it relates to churches or pastors adopting new technologies and methods), see this blog (http://www.mondaymorninginsight.com/html/DEC_06_04--MMI.htm) titled Innovators, Early Adopters, Early/Late Majority, Laggards: Which are You?.
Sincerely,
David Gillaspey
President
Great Church Websites
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.