[thelist] Tables and things

Lenore Snell lenore at sonic.net
Mon Jul 15 13:46:20 CDT 2002


If you used all percentage based table, it wouldn't be an issue.

If you need to use a pixel-based table, this can be elegantly resolved in 1 of
2 proper code ways. I couldn't open the page to view the code itself so I'm
basically this off of your example (thanks for providing that).

Conceptually, what happens is that tables tend to collapse to the width of the
largest graphic when no widths and heights are specified. I'm assuming your
article is mostly textual. If this is incorrect, or you'd like to show me a
page with the code, I can resolve this as well. If you do not specify widths
and heights of a table and you do not have images, the table tends to
appropriate space fairly evenly which may or may not work out for the article
that you have.Since there's no graphic in a text-based article, you should
have probably already notice that it will collapse - and it collapses
differently on various browsers.

These are two time-tested and common solutions many designers/coders will use:

1. I'm assuming your article has a colspan-4 although I'm not sure if it's a 4
column layout based on your diagram below. You can nest another table into the
article column and make that table percentage-based of 98% or 100% - test on
Netscape. Netscape tends to have issues with a 100% width nested table (it
sometimes pushes it out to 100% of the page, not the table). If that happens,
reduce to 98% or 99% to get the same effect. I tend to reduce to 98% to give
myself a bit of a reading room gap and resolve the Netscape conflict at the
same time. This way it'll wrap the text article to fit within the table cell.

2. The other way you can resolve this is to make a very thin added row at the
bottom. In each of these rows, force the width of the article with a 1 pixel
spacer graphic. The one con with this approach is that you would have to
define a minimum width. Well, or you can programmatically calculate the total
article length, determine an appropriate width for an article of that length
and insert the approprate 1 pixel graphic width and overall table width. That
may be more involved than you want - and more than is probably necessary.

Hope this helps!

Lenore


Jonathan_A_McPherson at rl.gov said:

> Joel,
>
> > So, my question: is there a way to tell it to expand the article column to
> its
> > full potential (or shrink the links column to its minimum for the content
> it
> > contains) without specifying a certain px width?
>
> Yes.
>
> This is not a terribly "proper" way to do things, but:
> (1) Use a width="1%" attribute on both your right-hand nav bar td and your
> left-hand graphic td.
> (2) Use a width="98%" attribute on your main content td.
>
> This will cause the browser to shrink the left- and right- hand cells as
> much as possible. (Technically, given an arbitrarily high resolution at
> which 1% of the available area was still more than you wanted the cells to
> take up, this could fail.)
>
> Jonathan.
>
> -----Original Message-----
> From: Joel Konkle-Parker [mailto:jjk3 at msstate.edu]
> Sent: Monday, July 15, 2002 10:59 AM
> To: thelist at lists.evolt.org
> Subject: [thelist] Tables and things
>
>
> I've got an XSLT stylesheet that transforms XML pages into XHTML pages (but
> that's not really important).
>
> As an example, look at:
> http://www.ballsome.com/games/software/articles/20020304-1.xml
>
> The entire page is embedded in a big table, as such:
>
> ----------------------------
> |  |<thead> - menus, etc   |
> ----------------------------
> |B |                |links||
> |a |  <tbody>       |     ||
> |l |                |form ||
> |l |  4 columns     |     ||
> |s |                |copy-||
> |o |  article       |right||
> |m |  content       |     ||
> |e |                |etc  ||
> ----------------------------
> |  | <tfoot> - 2 columns   |
> ----------------------------
>
> The entire width of the table is a set px number, but none of the columns
> have
> set widths or heights. In most of the pages, the article content is wide
> enough
> to wrap around, pushing the links column as narrow as possible with the
> content
> it contains. That's the desirable condition.
>
> Now, look at this page:
> http://www.ballsome.com/games/games.xml
>
> This has the same layout, except the article column isn't wide enough to
> fill
> itself, and it collapses in kind of an ugly fashion.
>
> So, my question: is there a way to tell it to expand the article column to
> its
> full potential (or shrink the links column to its minimum for the content it
> contains) without specifying a certain px width?
>
> -joel
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !
>



--
Lenore Snell
1000mph.net
lenore at bab5.org





More information about the thelist mailing list