我有一个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技术来实现这一点,但是我不能让它变得正确。Mootable是我发现的唯一能做到这一点的东西: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>
https://stackoverflow.com/questions/426398
复制相似问题