Search This Blog

CSS Table With Text Align Example

CSS Table With Text Align Example :
<!DOCTYPE html>
<html>
<head>
<title> kod4u </title>
<style type="text/css">
table, th, td {
border: 2px solid brown;
width: 20%;
}

th, td {
text-align: right;
}
</style>
</head>
<body>
<h1> Table With Text Align Example </h1>
<p> Here we use text align property in table th and td elements </p>
<table>
<tr>
<th> Firstname </th>
<th> Lastname </th>
</tr>
<tr>
<td> Amit </td>
<td> Ankit </td>
</tr>
<tr>
<td> Smith </td>
<td> Singh </td>
</tr>
</table>
</body>
</html>
OUTPUT
CSS Table With Text Align Example

No comments:

Post a Comment