Click here to get back home

fixing column width in a dynamic table

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
fixing column width in a dynamic table chimalus 12-13-2005
Posted by chimalus on December 13, 2005, 8:56 am
Please log in for more thread options


I am using a table with no column widths specified, letting the
table layout manager do its thing for figuring out the column
widths, and this works just fine.

Now I want to make the table dynamic. I have added a filtering
mechanism (in javascript) that can be used to hide unneeded
rows. However, each time I hide or show rows, the column sizes
change, and this doesn't look good.

Is there a way that I can preserve the column widths as originally
displayed? (I don't want to specify column widths at design time.)
I originally asked this question in a javascript group and they sent
me here; if there's a better place to post this, please let me know.

Thanks...

-- jeff


Posted by Tony on December 13, 2005, 10:14 am
Please log in for more thread options


chimalus@gmail.com wrote:
> I am using a table with no column widths specified, letting the
> table layout manager do its thing for figuring out the column
> widths, and this works just fine.
>
> Now I want to make the table dynamic. I have added a filtering
> mechanism (in javascript) that can be used to hide unneeded
> rows. However, each time I hide or show rows, the column sizes
> change, and this doesn't look good.
>
> Is there a way that I can preserve the column widths as originally
> displayed? (I don't want to specify column widths at design time.)
> I originally asked this question in a javascript group and they sent
> me here; if there's a better place to post this, please let me know.

Odd they would refer you elsewhere, since the answer lies in
javascript. Bascially, when you first load the page, you would want to
retrieve the actual widths of the columns, then set them using
.style.height

There may still be some resizing, but that would at least be a start.


Posted by Gérard Talbot on December 13, 2005, 8:26 pm
Please log in for more thread options


chimalus@gmail.com a écrit :
> I am using a table with no column widths specified, letting the
> table layout manager do its thing for figuring out the column
> widths, and this works just fine.
>
> Now I want to make the table dynamic. I have added a filtering
> mechanism (in javascript) that can be used to hide unneeded
> rows. However, each time I hide or show rows, the column sizes
> change,

This is to be expected. A column is as wide as its widest contained cell.


> and this doesn't look good.

The premisse still holds. As you remove a table row, the width of
columns should remain as wide as needed, to render the widest of its
contained cell. So, I don't understand why you say it does not look good.

>
> Is there a way that I can preserve the column widths as originally
> displayed?

Yes but why would you want to do that anyway?

Gérard
--
remove blah to email me

Posted by chimalus on December 13, 2005, 6:38 pm
Please log in for more thread options


G=E9rard Talbot wrote:
>
> The premisse still holds. As you remove a table row, the width of
> columns should remain as wide as needed, to render the widest of its
> contained cell. So, I don't understand why you say it does not look good.

It's an aesthetic issue, I suppose there's room for disagreement.
To me, it looks like the columns are jumping around and so I've got
to "reorient" myself. The filtering is done incrementally (on
each keystroke) so typing quickly results in a lot of shuffling.
I want the visual appearance to emphasis the idea that filtering
has just removed rows from the table (and no more).

>
> > Is there a way that I can preserve the column widths as originally
> > displayed?
>
> Yes but why would you want to do that anyway?

So what solution would you use?

-- jeff


Posted by Gérard Talbot on December 14, 2005, 2:35 pm
Please log in for more thread options


chimalus@gmail.com wrote :
> Gérard Talbot wrote:
>
>>The premisse still holds. As you remove a table row, the width of
>>columns should remain as wide as needed, to render the widest of its
>>contained cell. So, I don't understand why you say it does not look good.
>
>
> It's an aesthetic issue, I suppose there's room for disagreement.
> To me, it looks like the columns are jumping around and so I've got
> to "reorient" myself. The filtering is done incrementally (on
> each keystroke) so typing quickly results in a lot of shuffling.

I bet you do not use table to render tabular data on top of all this.

> I want the visual appearance to emphasis the idea that filtering
> has just removed rows from the table (and no more).
>
>
>>>Is there a way that I can preserve the column widths as originally
>>>displayed?
>>
>>Yes but why would you want to do that anyway?
>
>
> So what solution would you use?
>
> -- jeff
>

I've run some tests and the *_aesthetic_* issue appears in MSIE 6 but
not in Firefox 1.5, not in Seamonkey 1.5a and probably not in other
highly web-standards-compliant browsers.

Gérard
--
remove blah to email me

Similar ThreadsPosted
Implied width of implied center column in 3 column table June 30, 2008, 4:23 am
Is there a way to make row height equal to column width when you don't know value in advance? August 18, 2005, 1:37 pm
how to: a dynamic td width between static td widths? February 7, 2005, 3:08 pm
HTML or Javascript or PHP solution: Textarea with Dynamic Width July 16, 2004, 5:01 pm
Dynamic width of a text input field in a form November 8, 2005, 6:35 am
Manipulating a two-column table? March 8, 2006, 12:09 pm
table issue, centered column not possible, when text in other columns September 1, 2007, 3:34 pm
Table Positioning....dynamic? October 11, 2006, 3:55 pm
Fixing a Table of Contents Menu, when contents Scroll May 5, 2008, 7:40 am
Three column layout, middle column clear:both; affects other two columns;no tables March 9, 2007, 11:31 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap