![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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. |
#3
| |||
| |||
|
|
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? |
#4
| |||
| |||
|
|
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.) There is no width "as originally displayed." Without an explicit width |
#5
| |||
| |||
|
|
chimalus (AT) gmail (DOT) com wrote: There is no width "as originally displayed." Without an explicit width specification, the column width adjusts to the widest cell requirement. A way to reduce width changes is to set the table width to 100% and specify each column width. You can use <colgroup> and <col> to do so; or you can use CSS. In either case the widths may still change since that is the nature of table-cell. You may prevent that by using "overflow:hidden" for all <td>s but then some of the data may be clipped from view. |
#6
| |||
| |||
|
|
overflow: hidden does not work on table cells[1]. Ah. Quite so. |
|
td style="height:`xx;width:xx"><div style="height:100%;width:100%;overflow:hidden;"><! -- content here --></div></td |
#7
| |||
| |||
|
|
Doing this works as well: td { width: xx%; } td p { overflow: hidden; } Then place the data in <td><p> data </p></td>. Arrggh! IE, of course, needs some bludgeoning: |
#8
| |||
| |||
|
#9
| |||
| |||
|
#10
| |||
| |||
|
|
I don't want to specify column widths in the stylesheet since they're not known at design time. The "overflow:hidden" shouldn't be necessary because the table columns are already wide enough to accomodate all the text. - The widest width is not known. |
![]() |
| Thread Tools | |
| Display Modes | |
| |