我有一些html表格,其中的文本数据太大,不适合。因此,它垂直扩展单元格以适应这种情况。因此,现在有溢出的行的高度是数据量较少的行的两倍。这是不可接受的。如何强制表格具有与1em
相同的行高
这里有一些重现这个问题的标记。表格应该只有一行的高度,并隐藏溢出的文本。
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
table { width:250px; }
table tr { height:1em; overflow:hidden; }
</style>
</head>
<body>
<table border="1">
<tr>
<td>This is a test.</td>
<td>Do you see what I mean?</td>
<td>I hate this overflow.</td>
</tr>
</table>
</body>
</html>
https://stackoverflow.com/questions/1554928
复制相似问题