HTML -Table
HTML -Table
Note: A table cell can contain all sorts of HTML elements: text, images, lists, links, other tables,
etc.
Table Headers
Sometimes you want your cells to be table header cells. In those cases use the <th> tag instead
of the <td> tag: th stands for table header.
Table Rows
Each table row starts with a <tr> and ends with a </tr> tag. tr stands for table row.
Table Cells
Each table cell is defined by a <td> and a </td> tag. td stands for table data.
<body>
<h2>A basic HTML table</h2>
<table style="width:60%; background-color:lightcoral; border-collapse: collapse; color:white; ">
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr >
<td>Nutella</td>
<td>Berlin</td>
<td>Germany</td>
</tr>
<tr >
<td >IBM</td>
<td>Rome</td>
<td>Italy</td>
</tr>
<tr >
<td >Benz</td>
<td>Munich</td>
<td>Germany</td>
</tr>
<tr >
<td >Audi</td>
<td>Frankfurt</td>
<td>Germany</td>
</tr>
</table>