LoginSignup
8
8

More than 5 years have passed since last update.

文字列を全て表示する列と省略する列が両方あるHTMLのtable

Posted at

文字列を全て表示する列と省略する列を両方持つテーブル。
フロントの知識がまるでないと痛感。

sample.html
<html>
<head>
  <style>
    .fixed table {
      width: 100%;
      table-layout: fixed;
    }   

    th.fixed, td.fixed {
      max-width: 100px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }   
  </style>
</head>
<body>
  <table class="fixed">
    <thead>
      <tr>
        <th>visible</th>
        <th>hidden</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>あいうえおかきくけこさしすせそたちつてと</td>
        <td class="fixed">あいうえおかきくけこさしすせそたちつてと</td>
      </tr>
    </tbody>
  </table>
</body>
</html>
8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8