【发布时间】:2009-01-08 23:01:50
【问题描述】:
我有一个如下所示的 HTML 表格:
-------------------------------------------------
|Column 1 |Column 2 |
-------------------------------------------------
|this is the text in column |this is the column |
|one which wraps |two test |
-------------------------------------------------
但我希望它隐藏溢出。这里的原因是文本包含指向更多详细信息的链接,并且“换行”会在我的布局中浪费大量空间。它应该是这样的(不增加列或表格的宽度,因为它们会离开屏幕/否则会创建一个水平滚动条):
-------------------------------------------------
|Column 1 |Column 2 |
-------------------------------------------------
|this is the text in column |this is the column |
-------------------------------------------------
我已经尝试了很多不同的 CSS 技术来尝试实现这一点,但我无法让它变得正确。 Mootables 是我发现的唯一这样做的东西:http://joomlicious.com/mootable/,但我不知道他们是如何做到的。有谁知道我如何使用 CSS 和/或 Javascript 使用我自己的表格来做到这一点,或者 Mootables 是如何做到的?
示例 HTML:
<html><body>
<table width="300px">
<tr>
<td>Column 1</td><td>Column 2</td>
</tr>
<tr>
<td>this is the text in column one which wraps</td>
<td>this is the column two test</td>
</tr>
</table></body></html>
【问题讨论】:
标签: javascript html css