473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

CSS vs. Tables - When Tables win

Greetings,

I've been working on a 3-column layout where the center column is of a
fixed width (230px wide). The center column must always be 230px and
the columns on the right/left (always the same size as eachother) must
always take up the remaining width of the browser.

I have been designing for Firefox and IE and routinely viewing the
results in both.

My original aspiration was to avoid tables. I positioned the center
column first using "auto" left/right margins and absolute positioning
to achieve column centering. I then positioned the left/right columns
(floating both left, 50% width on each) over top of the absolutely
positioned center column. By setting right padding and left padding
respectively on the left and right columns, I was able to make the
inner text part away from the overlapped center column. (Sorry I
already trashed the CSS code!)

Here's the interesting thing. This worked as far as achieving the
desired layout. The trouble was with Firefox. The links shown in the
absolutely positioned middle column could not be clicked. This
probably resulted from the overlapping left and right columns. --
Imagine the browser is your stage and a column sits dead in the middle
of it. Then imagine that the curtains draw closed so that seam
between them runs up and down exactly in the middle. The curtains
prevent you from touching column behind them even though they are
transparent curtains! (IE had no such issue.)

PP PP P=padding area applied to left/right columns
+-----------------------+
| | : | |
| LEFT | CTR | RIGHT |
| COL | COL | COL |
| | : | |
| | : | |
| 1 | 2 | 3 |
| | : | |
+-----------------------+
:................. SEAM

In the end, I converted this easily to a table-based layout which
works fine. I wanted to avoid the table if only for better semantic
markup and faster display times on page loads.

Q1. Anyone ever created a three-column, pure CSS layout where the
center column is fixed and the left/right columns fluid (thus filling
100% of the browser width)? The edges of all columns must be
perfectly flush with each other.

I can see why so may web designers prefect fixed-width layouts.
They're far easier to control. Fluid layouts aren't bad so long as
every column spanning the page with has a percentage width. The real
issues that I had to design around involve the complexities with
combining indeterminate widths (based on percentages or ems) with
determinate ones (pixel based) and trying to get them to span 100% of
the width of any containing box. These things can be creatively
achieved, but because of browser discrepancies they can be harry.
Tables make achieving this simple. (When I set the table width to
100% and the center column to 230px, all browsers knew to distribute
the remaining width equally to the 2 remaining columns.) ...this is
just one situation where I found tables a blessing.

Q2. Anyone know if the W3C is proposing any new standards for a future
release of the CSS spec that will better handle the issue of fitting
indeterminite and determinate width boxes into a container so that the
entire width is used up?

I have some ideas myself, that could really make this easy.

Q3. Is there a suggestion box (email) to which I may send suggestions
to the W3C for consideration?

Mario T. Lanza
Clarity Information Architecture, Inc.
2004.09
Jul 20 '05 #1
2 2265
ml****@lycos.com (Mario T. Lanza) wrote:
Q1. Anyone ever created a three-column, pure CSS layout where the
center column is fixed and the left/right columns fluid (thus filling
100% of the browser width)? The edges of all columns must be
perfectly flush with each other.


Easy with CSS 2.0, it's just that IE's CSS support is relatively poor
that's causing trouble.

Loads of 3 column CSS layout examples out there (including examples
hacked to work in IE), Google is your friend.

--
Spartanicus
Jul 20 '05 #2
Mario T. Lanza <ml****@lycos.com>:

I've been working on a 3-column layout where the center column is of a
fixed width (230px wide).
Hopefully only used for bitmap images.
I have been designing for Firefox and IE and routinely viewing the
results in both.
Fascist!!1
My original aspiration was to avoid tables.
And of course you had a look at the various sites that describe in detail
how other people tried to build layouts like yours and similar ones.

Assumed (pseudo) code following.
I positioned the center column first using "auto" left/right margins and
absolute positioning to achieve column centering.
#foo {
width: 230px;
margin: 0 auto;
position: absolute; top: 0; right: ?; bottom: 0; left: ?;
}

Why both?
I then positioned the left/right columns
(floating both left, 50% width on each)
.bar {
float: left; width: 50%;
}
over top of the absolutely positioned center column.
<body><.bar #bar1/><.bar #bar2/><#foo/></body>
By setting right padding and left padding
respectively on the left and right columns,
.bar1 {padding-right: 115px;}
.bar2 {padding-left: 115px;}
(Sorry I already trashed the CSS code!)
Why?
The trouble was with Firefox. The links shown in the
absolutely positioned middle column could not be clicked.
Of course not, if #bar1 and #bar2 are higher in stacking. You might had
been able to solve this with 'z-index', but I'm not sure.
This probably resulted from the overlapping left and right columns.
Indeed. Congratulations, most people don't think of that.
In the end, I converted this easily to a table-based layout which
works fine.
Depending on your mark-up, it would have been quite easy to fake a table
for Firefox and other browsers of similar capability, like so:

<body><.bar/><#foo/><.bar/></body>

html {display: table}
body {display: table-row}
.bar,
#foo {display: table-cell}

I'm not sure, but IIRC IE ignores all "display: table-*" like it should.
If that's not the case you would need to use some advanced selectors, that
IE doesn't support.
Of course it's not enough to test such a layout in just two browsers.
I wanted to avoid the table if only for better semantic
markup and faster display times on page loads.
Personally I think, a simple three-cell layout-table can be justified. The
Safari developpers put a page online, that sums the reason up quite well,
but I'm too lazy to search for it now. (They used a little more nonsense
mark-up than IMO necessary, though.)
Q1. Anyone ever created a three-column, pure CSS layout where the
center column is fixed and the left/right columns fluid
Probably, the real problems arise only with footers.
<http://css-discuss.incutio.com/?page=ThreeColumnLayouts> is a good
starting point for a search.

Does anyone know an interactive approach like
<http://webdesign.crissov.de/temp/3cols/interactive> with more options and
being better tested?
I can see why so may web designers prefect fixed-width layouts.
They're far easier to control.
Only that control is nothing a webdesigner has.
Q2. Anyone know if the W3C is proposing any new standards for a future
release of the CSS spec that will better handle the issue of fitting
indeterminite and determinate width boxes into a container so that the
entire width is used up?
Like shown, the various table values for the 'display' property can
*already* do that. Only in supporting browsers, of course.
Q3. Is there a suggestion box (email) to which I may send suggestions
to the W3C for consideration?


There's a mailing list (<ww*******@w3.org>) and its archive
(<http://lists.w3.org/Archives/Public/www-style/>), where you'll find a
number of mails wanting something like you do, mostly not knowing or
accepting "display: table-*", because IE doesn't support it (yet).

--
"A wise man gets more use from his enemies than a fool from his friends."
Baltasar Gracian
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
44
by: Mariusz Jedrzejewski | last post by:
Hi, I'll be very grateful if somebody can explain me why my Opera 7.23 (runing under linux) doesn't show me inner tables. Using below code I can see only "inner table 1". There is no problem with...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
2
by: Jill Elaine | last post by:
I am building an Access 2002 frontend with linked tables to an encrypted Paradox 7 database. When I first create these linked tables, I'm asked for the password to the encrypted Paradox database,...
18
by: DP | last post by:
hi, i'm designing a video and games rental database. i've got the customer table, with all the correct and relavant details. i've got a films, and games table. But i'm confused which way to...
53
by: Alan Silver | last post by:
Hello, I understand the issue that tables should be used for tabular data and not for layout, but I would like some clarification as to exactly what constitutes tabular data. For example, if...
59
by: phil-news-nospam | last post by:
In followups by Brian O'Connor (ironcorona) to other posts, he repeats the idea that using tables in CSS is not something that should be done because IE doesn't support it. Of course I'm not happy...
10
by: Jim Devenish | last post by:
I have a split front end/back end system. However I create a number of local tables to carry out certain operations. There is a tendency for the front end to bloat so I have set 'compact on...
5
by: rdemyan via AccessMonster.com | last post by:
I have a need to add another field to all of my tables (over 150). Not data, but an actual field. Can I code this somehow. So the code presumabley would loop through all the tables, open each...
11
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.