0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

bootstrapでth, tdの幅、widthをいい感じに設定する方法

Posted at

th tdの設定方法

1、thの項目を決めて、幅を適当にいい感じに調整する。(そのものずばりの幅ではなく割合になるっぽい)

            <thead>
            <tr>
                <th style="width: 40px"> No.</th>
                <th style="width: 200px"> AA</th>
                <th style="width: 250px"> BB</th>
                <th style="width: 300px"> CC</th>
                <th style="width: 600px"> DD</th>
                <th style="width: 200px"> EE</th>
                <th style="width: 600px"> FF</th>
                <th style="width: 250px"> GG</th>
            </tr>
            </thead>

2、Chromeの検証を使って各thの実際の幅をみてメモ。

3、その幅通りにthにwidthを設定する。

            <tbody>
                <tr>
                    <td style="width: 35px">1</td>
                    <td style="width: 98px">2017/05/06</td>
                    <td style="width: 120px">AAAA</td>
                    <td style="width: 144px">BBBB</td>
                    <td style="width: 271px">CCCC</td>
                    <td style="width: 99px">DDDD</td>
                    <td style="width: 272px">EEEE</td>
                    <td style="width: 123px">FFFF</td>
                </tr>
              </tbody>
0
2
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
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?