首页htmltdHTML Element Style - 如何在表单元格中设置TD中的div宽度

HTML Element Style - 如何在表单元格中设置TD中的div宽度

我们想知道如何在表单元格中设置TD中的div宽度。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
div {
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100px;
}

td {
  white-space: nowrap;
}
</style>
</head>
<body>
  <table>
    <tr>
      <td>
        <div>Here is plenty of text to cut</div>
      </td>
    </tr>
  </table>
</body>
</html>