LoginSignup
0
0

More than 1 year has passed since last update.

【Rails】「【trタグ】とはなにか?」「【thタグ】と【tdタグ】の違いはなにか?」

Last updated at Posted at 2022-01-07

【trタグ】とはなにか?

・行を表すタグです。
・このタグの間に書かれたものが同じ行となります。

(例)商品名や個数を同じ行にする場合

<tr>
<th>商品名</th>
<th>個数</th>
<th>価格</th>
</tr>

【thタグ】と【tdタグ】の違いはなにか?

・thタグ:見出し用のタグ。太字で中央揃いになる。
・tdタグ:通常文用のタグ。左揃いになる。

thタグとは

・セルを意味するタグの1つ
・このタグの間にテキストを書く
・書かれた内容は見出しとなり太字で中央揃いとなる。

(例)「個数」という見出しにする場合

<th>個数</th>

tdタグとは

・セルを意味するタグの1つ
・このタグの間にテキストを書く
・書かれた内容は通常の文となり左揃いとなる。

(例)数字を書く場合

<td>300</td>

引用元:https://www.hibinokoto01.com/entry/2017/02/27/044737

0
0
2

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
0