Skip to page content or skip to Accesskey List.
Search evolt.org
evolt.org login: or register

Work

Main Page Content

Liquid Tables

Rated 4.17 (Ratings: 15) (Add your rating)

Log in to add a comment
(12 comments so far)

Want more?

 
Picture of r937

rudy limeback

Member info | Full bio

User since: December 13, 1998

Last login: July 10, 2007

Articles written: 12

How do you make a web page that looks good no matter how wide the browser window is? Use liquid tables, a technique that lets you "pour" your content into the page so that it flows to the margins, even if the window is resized.

Wait a sec, doesn't the good old HTML <p> tag allow content to flow? Yes, but the problem is, you often need parts of the page to remain fixed, such as a navigation bar down one side. The challenge is to have both a fixed and a flexible portion of the page. This is where liquid tables will help you.

Let's start with some definitions:

ice: fixed width

jello: somewhat flexible, often centered

liquid: flexible width

Here are a couple of good explanations of the basic differences between these three techniques:

The problem with an "ice" design, which might use a fixed table width of, say, 600 pixels, is that if the browser window is narrower than 600, you get a horizontal scrollbar, and if the browser window is very much wider than 600, you get a lot of white space.

One type of "jello" design also uses a fixed width table, but centered in the window -- this looks somewhat better when the browser window is substantially wider than the table. Another type uses a table that is a certain percentage of the browser window, say 80%. This allows the table to expand or contract depending on the width of the browser window, and it minimizes the amount of white space at all widths. But it doesn't allow for a fixed portion, that stays fixed -- for that, you need to use a liquid table.

The general approach to creating a liquid table is this:

  1. give pixel widths to fixed columns

  2. give percentage widths to liquid columns

However, you may still run into problems. Some browsers will disregard the pixel widths and try to "balance" the widths of the columns. Therefore you need some way to "force" the liquid columns to expand as much as possible.

Let's take a look at some techniques. The following resources give detailed explanations for how to build liquid tables:

Note that one of the resources suggests that you not specify a percentage width for the table. Does this work? Yup, but it assumes the liquid column has enough content to push the table out to the window margins, otherwise the fixed column tends to expand beyond its specified pixel width. Remember, browsers regard column widths only as a recommendation, usually a minimum. And they will happily override the stated width if necessary, and make the fixed column either narrower or wider.

Another approach does not use percentage widths for the liquid columns, but rather an "absurd" fixed column width such as 2000 pixels. This forces the liquid column to "squeeze" the fixed column, thereby keeping it to its minimum width. This technique assumes a table percentage width, which most browsers (Opera is an exception) will honour -- specifying width=100% for the table will "override" the absurdly large column width. This technique probably dates back to HTML 3.2 when percentages were not allowed on columns -- see the W3C HTML 3.2 table specs. Percentages for columns are valid in the HTML 4 table specs, so it now makes sense to give the liquid column a cell width of 90% or 100%. But be warned that older browsers may disregard these percentages if they were written for HTML 3.2.

In either case you will probably need to ensure that the fixed columns do not get squeezed narrower than their minimum pixel widths, and the most reliable way seems to be to use a transparent spacer gif.

Finally, with a truly liquid table, you will still have the problem of long lines of text at very wide window widths. One way to deal with this is to use a table width of less than 100% -- say 80%. This does not eliminate the problem of long lines of text, it just reduces it.

The bottom line on liquid tables is that you have to test your design. Create a test page like this one --

Test your design in several browsers. Test it at different resolutions. Resize the window. Try to break the design. Bump your fonts up a few notches. Ask for a site critique on your favourite web developer discusion list.

And don't forget to have fun. ;o)

My involvement with evolt.org goes back to 1998, as one of the original founders. I'm an SQL consultant who dabbled in web development for several years, in the "golden age" between HTML 2 and XHTML 1.1. My web sites are r937.com and rudy.ca. I live in Toronto, Canada, and you are all cordially invited to come and visit and play a round of frisbee golf with me.

Submitted by Anonymous on July 6, 2000 - 10:41.

If you are careful in doing the sums, the td width="manyThousand" hack, can work for more than one flexible column.
Check out the zulusports home page
http://www.zulusports.com
where we have 4 flexible width columns. A minor feat :)

login or register to post comments

Submitted by divinentd on December 9, 2000 - 14:19.

I've been trying "liquify" a table vertically as well as horizontally:
www.divinentd.com/screen
No luck thus far since Netscape doesn't like the height table attribute. Any thoughts?

login or register to post comments

NN6 Liqud Tables

Submitted by echo on February 23, 2001 - 06:47.

If you design a liquid table to be centered, and have a percentage width of less than 100%, NN6, at certain window widths, shows a one pixel vertical line of the page background color, in between a middle liquid width cell and end cell. It seems that at these certain browser widths, NN6 does some rounding off to make sense of the conflicting percentages, and results in the dropped pixel from the 100% width cell. The workaround is to remove the table tag width attribute (the less than 100% width) and nest it in another table with the desired table tag percentage width attribute. You can see a demo of this at: http://www.echozone.com/nn6.html

login or register to post comments

A fabulous tutorial!!

Submitted by r937 on May 3, 2001 - 13:58.

I've just found a fabulous tutorial that walks through the process of designing a liquid table, using popup windows to illustrate the steps in the process. Yes, it uses nested tables, but boy, is it a nice tutorial --
Flexible Page Layout Using Tables
http://www.jshook.com/flexible_pages/

login or register to post comments

disagree with the premise...

Submitted by rconway on May 29, 2001 - 08:02.

I disagree with the premise, which seems to be ubiquitously swallowed without complaint, that liquid tables are inherently a good idea. "Ooh, looky," the eager designers say, "It's stretchy! It must be good!" I had a somewhat famous web designer tell me that the bigget problem with my site was that my tables weren't liquid. If that's the worst problem, I'll take it!

My issue is that I don't think it is inherently a good idea to use all available screen real estate. Above it says "The problem with 'ice' sites is that [...] if the browser window is very much wider than 600, you get a lot of white space." Oh no! Not white space! Heaven forbid.

In far too many sites, a liquid table results in lines of copy that are 800 or even 1024 pixels wide. That's far too long for the human eye to scan. Pick a book off your shelf. Any book. How wide is the column of text on a typical page? There's a reason most books are the size they are, folks. There's a reason that common paper is only 8.5 inches wide. There's a reason newspaper articles are columnar. It's because readability is greatly enhanced by reasonably narrow columns of text. Our ability to discern the "shape" of words and therefore read quickly is greatly reduced by long lines of text.

I am not saying liquid tables are necessarily a bad idea. Merely encouraging you to consider that neither are they necessarily a good idea.

login or register to post comments

640x480? anyone?

Submitted by aardvark on May 30, 2001 - 14:46.

Almost two years ago I wrote about how 640x480 isn't dead. And clearly it isn't. However, one advantage a liquid site has over a site at greater than 600 pixels in width is its ability to scale and address issues or printing, readability, and even design (by forcing the designer to still use smaller images).

No, liquid isn't going to address 100% of your needs, but it's a step up. And it allows (empowers) users to choose a comfortable text length to read, since we as developers would like to assume that no one will surf full-screen if they can't read the text.

login or register to post comments

depending on the visual design on the site..

Submitted by plainsman on July 5, 2001 - 01:26.

liquid tables are good, but of course, only if the occassion calls for it...especially for bulletin boards, when they resize beautifully on 1280x1024 and runs seamless on 640x480 thats great. otherwise, if the site has more of a multimedia feel to it wif flash content areas rather than content tables laid out right to left, top to bottom it might not be such a good idea.

login or register to post comments

another article...

Submitted by r937 on November 23, 2001 - 13:38.

http://www.dantobias.com/webtips/tables.html

login or register to post comments

CSS Anyone?

Submitted by haidary on December 16, 2001 - 04:45.

Was wondering if you guys had any good links to tutorials on liquid design using CSS. I've been hearing more and more about liquid design with the integration of CSS for a more compatable, easy to edit design. I know that CSS doesn't have the support it should but as even a few articals here state, support is rapidly improving.

login or register to post comments

some CSS, but principles in general...

Submitted by aardvark on December 16, 2001 - 10:58.

Haidary, I've written an article for the site called Liquid Design for the Web that addresses some overall design issues. It suggests the use of CSS1 for background imagery and the like, but doesn't detail CSS-P methods of layout. This is partly because there are other sites out there doing it pretty well, and partly because the support in my user base isn't there to warrant the dumping of layout tables yet. Either way, see if that article helps in any way.

login or register to post comments

nice article

Submitted by mwarden on March 14, 2002 - 12:06.

Just used this article... again. Thanks, rudy!

login or register to post comments

rconway comment about liquid tables

Submitted by malmond on June 20, 2004 - 15:30.

I agree with "rconway" statement (rconway wrote on 05/29/2001 at 09:02 AM ) about liquid tables. He or she (forgive me, I am new here) certainly could have used more tact, but this is an inherent problem or "condition" (to be diplomatic) of online communication style; emails, forums, chat rooms,etc... you can get away with a lot given that you are essentially anonymous. But that is beside the point.

I begin my career as a print designer and of course, studied Typography. This is a discipline that has been with us for hundreds of years, and the principles of "good Typography" (the use of type and/or guidelines that create an ideal or "readable" page of text, for instance...which I think of as "usable") do vary depending on usage and form of media. This is certainly true in regards to text type on a Web page.

But this is actually a different issue than the fact that browsers display at different resolutions and can be resized; that is a matter of user preference. I have had a number of clients complain about what happens to certain Web pages when they resize their browser window. But as we discuss the issue , and I listen to them (a very important and almost always forgotten aspect of client collaboration), the result is always the same: We identify the actual problem and it is not that they want more words filling up their browser window. In fact, I almost always also hear the opposite during the assessment phase of a project: "We don't like clutter. We like simple, clean sites" and so on...

The problem is that they simply don't like the overall look of a site that is left in a static, left justified format (Ice, I think was the term). The "white space" is not the problem either, it is where the white space exists in the overall design of the page, which includes the entirel viewable screen on the user's monito; something about design distracts them from the content, which is a no-no. But rconway is exactly on target. There are certain principles in typography, based on cognitive studies of how the human brain and eye functions when we read that inform the guidelines for ideal readability. I was always taught the a line length containing approximately 10-14 words on average was ideal for the reader's eye to easily return to the next line of copy without losing where she/is.

Yes, I know, users don't read, they "scan" Web pages, but the concept is the same. Have you tried to scan, let alone read, a paragraph of text that is 20-30 words in length? It is very difficult. I also realize that users prefer to read text at different sizes, but this too is not a call for the longest possible line of copy.

My solution, like so many others', is to use a centered page that adjusts (is fluid) as the monitor is resized but always remains a fixed width and stays centered. It never fails to solve the problem. Now the page looks like a "well designed, easy to read" page no matter the browser setting.

So I am in agreement with both sides; in the middle, so to speak, on the issue. I just think that the designer needs to identify what the real issues are instead of just assuming that a new form of media or technology simply rewrites all the rules. Thanks for lettering me share.

login or register to post comments

The access keys for this page are: ALT (Control on a Mac) plus:

evolt.orgEvolt.org is an all-volunteer resource for web developers made up of a discussion list, a browser archive, and member-submitted articles. This article is the property of its author, please do not redistribute or use elsewhere without checking with the author.