A basic HTML table
A basic HTML table
A basic HTML table <p>Use the CSS border property to add <tr>
<!DOCTYPE html> a border to the table.</p> <th>Firstname</th>
<html> <table style="width:100%"> <th>Lastname</th>
<style> <tr> <th>Age</th>
table, th, td { <th>Firstname</th> </tr>
border:1px solid black; <th>Lastname</th> <tr>
} <th>Age</th> <td>Jill</td>
</style> </tr> <td>Smith</td>
<body> <tr> <td>50</td>
<h2>A basic HTML table</h2> <td>Jill</td> </tr>
<table style="width:100%"> <td>Smith</td> <tr>
<tr> <td>50</td> <td>Eve</td>
<th>Company</th> </tr> <td>Jackson</td>
<th>Contact</th> <tr> <td>94</td>
<th>Country</th> <td>Eve</td> </tr>
</tr> <td>Jackson</td> <tr>
<tr> <td>94</td> <td>John</td>
<td>Alfreds Futterkiste</td> </tr> <td>Doe</td>
<td>Maria Anders</td> <tr> <td>80</td>
<td>Germany</td> <td>John</td> </tr>
</tr> <td>Doe</td> </table>
<tr> <td>80</td> </body>
<td>Centro comercial </tr> </html>
Moctezuma</td> </table> Border Style
<td>Francisco Chang</td> </body> <!DOCTYPE html>
<td>Mexico</td> </html> <html>
</tr> Round Border <head>
</table> <!DOCTYPE html> <style>
<p>To understand the example better, <html> th, td {
we have added borders to the <head> border-style: dotted;
table.</p> <style> }
</body> table, th, td { </style>
</html> border: 1px solid black; </head>
Add Border to table border-radius: 10px; <body>
<!DOCTYPE html> }
<html> </style> <h2>Table With Dotted Borders</h2>
<head> </head> <p>Use the CSS border-style property
<style> <body> to set the style of the borders.</p>
table, th, td { <h2>Table With Rounded <table style="width:100%">
border: 1px solid black; Borders</h2> <tr>
} <p>Use the CSS border-radius property <th>Firstname</th>
</style> to add rounded corners to the <th>Lastname</th>
</head> borders.</p> <th>Age</th>
<body> <table style="width:100%"> </tr>
<h2>Table With Border</h2>
2