473,796 Members | 2,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2285
ml****@lycos.co m (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.c om>:

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=ThreeColu mnLayouts> is a good
starting point for a search.

Does anyone know an interactive approach like
<http://webdesign.criss ov.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
6786
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 the SQL Profile to watch the T-SQL-Command which Access ( who creates the commands?) creates and noticed:
44
3899
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 other browsers (I checked it under Konqueror). Thank you in advance for your help. Regards. /Mariusz <HTML>
3
24039
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 tables in the database where the code resides. If we move the database with the data tables to a new directory, the links are no longer valid. I tried to update the links by changing the Connect property and refreshing: Set td = db.TableDefs(0)...
2
6011
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, and the linked tables are successfully created. I use the data from these linked tables in several forms. All works great until I close the Access frontend and open it again. When I try to use the forms, I get an error message: "Could not...
18
1612
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 link them. e.g.
53
4242
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 I have a form, in which the user is required to fill in various bits of information, then laying out with a table makes it easy. A basic example...
59
3669
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 about the fact that IE doesn't support CSS tables. But what can one do about that? And tables of one type or the other are needed in some cases (regardless of whether some people feel it is appropriate or not). So the issue I and considering...
10
7707
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 close' I think that I have read in some threads (althoug I cannot find them now) that others place such tables in a local, linked database. I could do this but I am interested to know what would be the advantages. And disadvantages, if any. Any...
5
4103
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 table in design mode and then add the new field and set its properties. Thanks. --
11
3685
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) and the 'employee name'. There is another table which assigns an ID to the Shifts, i.e. 1,2 and 3 for morn, eve & night shifts respectively. From the mother table, the incentive is calculated datewise for each employee as per his shift duty. In...
0
9680
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10456
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10230
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10174
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7548
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.