HTML Tutorial 12: Creating Table Headers


Welcome to your website development training.

Today am going to teach how to create table headers.

When you have a table with some data in it, people might be confused of what each column means and in other to have a clear table structure, we need to create a table headers.

Let's go ahead and create a new file on our anWriter free HTML editor and save it with table.html

Paste this code in your new empty table.html file u just created👇

_____start from <!doctype html>______

<!doctype html>
<html>
<head>
<title>TopCrix Studio</title>
</head>
<body>
<table border="1">
<tr>
<th>Name</th>
<th>Music</th>
<th>Who they Love</th>
</tr>
<tr>
<td>Tiwa Savage</td>
<td>Bad</td>
<td>Wizkid</td>
</tr>
<tr>
<td>Yemi Alade</td>
<td>Johnny</td>
<td>Crix Josh</td>
</tr>
<tr>
<td>Simi</td>
<td>Joromi</td>
<td>Adekunle Gold</td>
</tr>
</table>
</body>
</html>

______stop at </html>_______

Preview and you'll see that you have a table header with dark text centered at the very top which is different from the 3 other columns below, right?

The <th></th> is what gives us the different, so anytime you wish to make a table, always remember to add a table header for your website visitors to understand what your table is all about.

Is that clear?

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Search