Creating HTML Table Headings:
Creating HTML Table Headings: HTML tables do allow you to create heading both vertical and horizontal. We use <th></th> tag to denote table headings in HTML. Let us create our first HTML table with heading on top row to show the potential of an HTML page:
Step 1:
Create a sample table with two rows.
<table> <tr></tr> <tr></tr> </table> |
Step 2: Now begin with creating table headings inside the first row
<tr> <th> Pakistan</th> <th>India</th> <th>Australia</th> <th>England</th> </tr> |
Step 3: Add some data in the 2nd row of our HTML table.
<tr> <td> 1st Position</td> <td> 2nd Position</td> <td> 3rd Position</td> <td> 4th Position</td> </tr> |
Step 4: Test your code in a web browser for results. The result will show a header containing country names while a second row containing country positions. You may see the below result: