Tableタグってなんぞや
HTMLで表を作成する際に利用するタグのこと。
実際にコード書いてみる
tr:テーブルの行部分(横方向)を指定するタグ。
th:テーブルの見出しやタイトルとなるセルを指定するタグ。
td:テーブルのセル内容を作成を指定するタグ。
①trとtdタグで作成したテーブル
タイトル | 名前 | 日付 |
Tableタグ周りがよーわからんくなったので整理してみた。 | ともひろ | 2022年9月24日(土) 15:37:11 |
table1.html
<table>
<tr>
<td>タイトル</td>
<td>名前</td>
<td>日付</td>
<tr>
<td>Tableタグ周りがよーわからんくなったので整理してみた。</td>
<td>ともひろ</td>
<td>2022年9月24日(土) 15:37:11</td>
</tr>
</table>
②trとthとtdタグで作成したテーブル
タイトル | 名前 | 日付 |
---|---|---|
Tableタグ周りがよーわからんくなったので整理してみた。 | ともひろ | 2022年9月24日(土) 15:37:11 |
table2.html
<table>
<tr>
<th>タイトル</th>
<th>名前</th>
<th>日付</th>
</tr>
<tr>
<td>Tableタグ周りがよーわからんくなったので整理してみた。</td>
<td>ともひろ</td>
<td>2022年9月24日(土) 15:37:11</td>
</tr>
</table>
結論
自分で書いてみるのが一番わかるかも?🍺