0
鑑於下面的html表格,我想通過設置'col'元素的寬度而不是將其設置在div上來控制第一列的寬度元素,而不會丟失省略號。這只是使用HTML和CSS可能嗎?如何控制HTML表格列寬與文本溢出結合
<html>
<head>
<style>
.hideextra { white-space: nowrap; overflow: hidden; text-overflow:ellipsis; }
</style>
</head>
<body>
<table style="width: 300px">
<col /><!-- ** set width here ** -->
<tr>
<td>Column 1</td><td>Column 2</td>
</tr>
<tr>
<td>
<div class="hideextra" style="width:200px">
this is the text in column one which wraps</div></td>
<td>
<div class="hideextra" style="width:100px">
this is the column two test</div></td>
</tr>
</table>
</body>
</html>