Set the text alignment in <td> elements to "right". - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Set the text alignment in <td> elements to "right".

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
table, td, th {
    border: 1px solid black;
}
td {<!--   www  .j a  v a 2 s. c  om-->
    text-align: right;
}
</style>
</head>
<body>

<table>
  <tr>
    <th>Firstname</th>
    <th>Lastname</th>
  </tr>
  <tr>
    <td>A</td>
    <td>B</td>
  </tr>
  <tr>
    <td>C</td>
    <td>B</td>
  </tr>
</table>

</body>
</html>

Related Tutorials