Enter your email id to get regular update free
Login
Your Email
Pasword

How to add HTML Tables?

An HTML table is defined with the <table> tag to add table on the web page.

Each table row is defined with the <tr> tag. 
A table header is defined with the <th>  tag. 
A table cell is defined with the <td> tag.
Table headings are bold and centered by default. 
E.g:
<table style="width:200%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Jack</td>
<td>Rich</td>
</tr>
</table>

Adding a Border in HTML table
To add a  border for table  use the CSS border property.
table, th, td
{ border: 1px solid black;
}

 Collapsed Borders in HTML
The borders to collapse into one border add the CSS border-collapse property.
table, th, td
{ border: 1px solid black;
 border-collapse: collapse;
}

Add a Cell Padding
Cell padding is use to specify the space between the cell content and its borders. Use the CSS padding property for it.
th, td
 {
 padding: 20px;
}
HTML
Tables
Styling
Ayesha
Tech writer at newsandstory
Total 101 views