LoginSignup
0

More than 1 year has passed since last update.

【HTML】「tr」「th」「td」 の違い

Last updated at Posted at 2022-05-05

「tr」

tr= 「Table Row」
「表の行」という意味。
つまり、「tr」は「表の行」の要素に値する。

「th」

th= 「Table Header」
「表の見出し」という意味。
つまり、「th」は「表の見出し」の要素に値する。

「td」

td= 「Table Data」
「表のデータ」という意味。
つまり、「td」は「表のデータ」の要素に値する。

コード

index.html
<table>
	<thead>
		<tr> ←表の行
			<th>見出し1</th>
		</tr>
	</thead>
	<tbody>
		<tr>←表の行
			<td>データ1</td>
			<td>データ2</td>
		</tr>
	</tbody>
	<tfoot>
		<tr>←表の行
			<td>データ1</td>
			<td>データ2</td>
		</tr>
	</tfoot>
</table>

まとめ

  • 「tr」は「表の行」の要素に値する。
  • 「th」は「表の見出し」の要素に値する。
  • 「td」は「表のデータ」の要素に値する。

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