【发布时间】:2012-07-31 17:09:41
【问题描述】:
在 Windows 应用程序中,我们经常看到在一行中可见的表格数据。列有一些最大宽度,其余文本被截断。可以通过在所述列上单击并拖动鼠标来使所述文本可见。
可以通过 JavaScript/jQuery 或(不太理想的)devexpress 在 Web 中模拟这种行为吗?
换句话说,我怎样才能扩展...
<table>
<tr>
<td>column data</td>
<td>column 2 data lots of text where this text does not fit on screen and is truncated</td>
</tr>
</table>
【问题讨论】:
-
根据您的需要,您也可以使用一点 CSS 和 jQuery 轻松地模拟这一点。
td {max-width: 50px; max-height: 12px; overflow: hidden; }$(td).dblclick(function(e) { $(e.currentTarget).css('max-width', 'none' }); -
@HerroRygar - 不错的想法,但如果涉及超过 1 行,事情就会变得棘手。
标签: c# javascript jquery asp.net-mvc-3