{ A destination to learn coding }

Tables

Some data needs to be presented in the tabular form. For example, time table, comparisons, complex data etc. Html provides us with the table tag to do so.

Table Tag

<table> </table>

This is the main tag. This element is used to create a table in a website.


The tr tag

<tr> </tr>

This tag indicates the table row.


The th tag

<th> </th>

Table heading tag. This tag is used for the row and column headings


The td tag

<td> </td>

This is table data tag. Every row contains columns. This tag makes up a column. You can add as many columns as you want using the td tag.


Example of a simple table


<table>
	<tr>
	   <th>Name of the student</th>
	   <th>Age</th>
	</tr>
<!-- this is a comment in html. It starts with <!-- and ends with -->  -->
	
<!-- Here second row starts-->
	
	<tr>
	   <td>Raj</td> <!-- First column-->
	   <td>18</td> <!-- Second column-->
	</tr>
	
<!-- Third row starts-->
	<tr>
	   <td>Akbar</td>
	   <td>5</td>
	</tr>
	
<!-- Fourth row starts-->
	<tr>
	   <td>Wayne</td>
	   <td>12</td>
	</tr>
	
</table>	
			
See output
learn css