0 votes
124 views
in HTML by (3.5k points)
edited

How to create a table in HTML?

1 Answer

0 votes
by (3.5k points)
edited

HTML tables help web developers to set the data into rows and columns.

The <table> tag is there in the HTML table.
Each table row can be defined with a <tr> tag.
Each header can be defined with a <th> tag. 
Each data or the cell is defined with a <td> tag.
If your text is in the  <th> elements then they will be bold and centered.
If your text is in the <td> elements then they will be regular and left-aligned.

<table style="width:100%">
  <tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Hobbies</th>
  </tr>
  <tr>
    <td>Ram</td>
    <td>Kumar</td>
    <td>Travelling</td>
  </tr>
  <tr>
    <td>Shyam</td>
    <td>Chadra</td>
    <td>Reading books</td>
  </tr>
</table>

Related questions

0 votes
1 answer 133 views
asked Jun 24, 2023 in HTML by Doubtly (98.9k points)
0 votes
1 answer 141 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)
0 votes
1 answer 105 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)
0 votes
1 answer 125 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)
0 votes
1 answer 132 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)
0 votes
1 answer 124 views
asked Aug 19, 2022 in HTML by codelikepro (3.5k points)

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

559 users

...