Table
Styling the table:
● border-collapse: collapse; It makes the border a single line.
● background- color: lightblue; It changes the background color.
● color: darkblue; It changes the color of the text.
● <table style="width:100%"> It changes the width of the cell into 100.
● <th style="width:70%">Firstname</th> It changes the width of the cell into 70.
● border-color: darkred; It changes the color of the border.
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.
Everything between <td> and </td> is the content of a table cell.
The following values are used to create border:
<!DOCTYPE html>
<html>
<style>
table, th, td {
border:1px solid white
;
}
</style>
<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>