CSS Table Borders

Please Share On:

Definition:

CSS table border properties are used to change the look of HTML tables. If you have read about CSS borders yet, then you first go to the border chapter and know more about the border and use their properties in CSS. “Click Here”, it will take you to the border chapter.

Source Code:

<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
  border: 1px dashed red;
}
</style>
</head>

<body>
<h3>Example of CSS border table </h3>

<table>
  <tr>
    <th>Roll No.</th>
    <th>First Name</th>
    <th>Last Name</th>
    <th>Hobby</th>
  </tr>
  <tr>
    <td>1.</td>
    <td>Harry</td>
    <td>Potter</td>
    <td>Acting</td>
  </tr>
  <tr>
    <td>2.</td>
    <td>Brad</td>
    <td>Pitt</td>
    <td>Acting</td>
  </tr>
  <tr>
    <td>3.</td>
    <td>David</td>
    <td>Warner</td>
    <td>Sports</td>
  </tr>
</table>
</body>
</html>

Output:




You may be interested in the following topics:

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright @2023. All Right Reserved.


Social media & sharing icons powered by UltimatelySocial