在动态表中修复列宽 [英] fixing column width in a dynamic table

查看:75
本文介绍了在动态表中修复列宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个没有指定列宽的表,让

表格布局管理器为确定列

宽度而做的事情,这很好用。


现在我想让表格动态化。我添加了一个过滤

机制(在javascript中),可以用来隐藏不需要的
行。但是,每次我隐藏或显示行时,列大小

都会改变,这看起来不太好。


我有办法吗?可以保留最初显示的列宽?

? (我不想在设计时指定列宽。)

我最初在一个javascript小组中问这个问题,他们在这里发了

我;如果有更好的地方发布,请告诉我。


谢谢...


- jeff

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

推荐答案

ch ****** @ gmail.com 写道:
我使用的是一个没有指定列宽的表格,让
表格布局管理器做出来确定列的宽度
,这很好用。

现在我想让表动态。我添加了一个过滤
机制(在javascript中),可用于隐藏不需要的行。但是,每次我隐藏或显示行时,列大小都会改变,这看起来不太好。

有没有办法可以保持列宽如原来的<显示? (我不想在设计时指定列宽。)
我最初在一个javascript小组中问了这个问题,他们在这里发了我的意思。如果有更好的地方发布这个,请告诉我。
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.




奇怪他们会把你推荐到其他地方,因为答案在于

javascript。基本上,当你第一次加载页面时,你会希望

检索列的实际宽度,然后使用

..style.height
设置它们

可能还有一些调整大小,但这至少是一个开始。



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.


ch ****** @ gmail.com écrit:
我使用的是没有指定列宽的表,让
表布局管理器做出确定列宽度的事情,这很好用。

现在我想让表动态化。我添加了一个过滤
机制(在javascript中),可用于隐藏不需要的行。但是,每次我隐藏或显示行时,列大小都会改变,


这是可以预料的。一列与其最宽的单元格一样宽。


,这看起来不太好。


预售仍然有效。当您删除表格行时,

列的宽度应保持为所需的宽度,以呈现其最宽的

包含的单元格。所以,我不明白为什么你说它看起来不太好。

有没有办法可以保持最初显示的列宽?
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?




是的但是你为什么要这样做?

$ b $bGérard

-

删除等等给我发电子邮件



Yes but why would you want to do that anyway?

Gérard
--
remove blah to email me


GérardTalbot写道:
Gérard Talbot wrote:

该报道仍然有效。当您删除表格行时,
列的宽度应保持为所需的宽度,以呈现其最宽的包含单元格。所以,我不明白为什么你说它不好看。


这是一个美学问题,我想有分歧的余地。

对我而言,看起来像是在跳跃所以我有b $ b来重新定位我。过滤是以递增方式完成的(每次击键时间为
)因此快速输入会导致大量的改组。

我希望视觉外观强调过滤的概念
刚刚从表中删除了行(并且没有更多)。

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?




你会用什么解决方案?


- jeff



So what solution would you use?

-- jeff


这篇关于在动态表中修复列宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆