<html>
<head>
<title>Table Border</title>
</head>
<body>
<table border="1">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sample Name</td>
<td>Sample Description</td>
</tr>
<tr>
<td>Sample Name-2</td>
<td>Sample Description-2</td>
</tr>
</tbody>
</table>
</body>
</html>
<html>
<head>
<title>Table Border Collapse</title>
<style>
table, th, td {
border: 2px solid black;
border-collapse: collapse;
}
</style>
</head>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sample Name</td>
<td>Sample Description</td>
</tr>
<tr>
<td>Sample Name-2</td>
<td>Sample Description-2</td>
</tr>
</tbody>
</table>
</body>
</html>
Name | Description |
---|---|
Sample Name | Sample Description |
Sample Name-2 | Sample Description-2 |
<html>
<head>
<title>Table Padding</title>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 10px;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sample Name</td>
<td>Sample Description</td>
</tr>
<tr>
<td>Sample Name-2</td>
<td>Sample Description-2</td>
</tr>
</tbody>
</table>
</body>
</html>
Name | Description |
---|---|
Sample Name | Sample Description |
Sample Name-2 | Sample Description-2 |
<html>
<head>
<title>Table Width and Height</title>
<style>
table, td, th {
border: 1px solid black;
}
table {
border-collapse: collapse;
width: 100%;
}
th {
height: 50px;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sample Name</td>
<td>Sample Description</td>
</tr>
<tr>
<td>Sample Name-2</td>
<td>Sample Description-2</td>
</tr>
</tbody>
</table>
</body>
</html>
Name | Description |
---|---|
Sample Name | Sample Description |
Sample Name-2 | Sample Description-2 |
<html>
<head>
<title>Table Text Align</title>
<style>
table, td, th {
border: 1px solid black;
}
table {
border-collapse: collapse;
width: 100%;
}
th {
text-align:center;
}
td {
text-align:left;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sample Name</td>
<td>Sample Description</td>
</tr>
<tr>
<td>Sample Name-2</td>
<td>Sample Description-2</td>
</tr>
</tbody>
</table>
</body>
</html>
Name | Description |
---|---|
Sample Name | Sample Description |
Sample Name-2 | Sample Description-2 |
<html>
<head>
<title>Table Colors and Backgrounds</title>
<style>
table, td, th {border: 1px solid black; }
table{border-collapse: collapse; width: 100%;}
th{ height: 50px; text-align:center; background:#F60; color:#FFF;}
td{ text-align:center; background:#FC0; color:#000;}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sample Name</td>
<td>Sample Description</td>
</tr>
<tr>
<td>Sample Name-2</td>
<td>Sample Description-2</td>
</tr>
</tbody>
</table>
</body>
</html>
Name | Description |
---|---|
Sample Name | Sample Description |
Sample Name-2 | Sample Description-2 |