HTML Table: Formatting all tables and cells the same way

This entry is part 13 of 16 in the series HTML Table

To format all tables and cells the same way, define the attributes in an embedded style sheet.

<!DOCTYPE html>
<html>
<head lang='en'>     
    <meta charset='UTF-8'>
    <title>Codecrawl.com-HTML Table</title>
    <style>
        table {
            border-style: dotted;
            border-color: red;
            border-width: 1px;
        }

        td {
            border-style: dashed;
            border-color: green;
            border-width: 1px
        }

    </style>
</head>
<body>

<table>
    <tr>
        <th>ID</th>
        <th>artiste</th>
        <th>album</th>
    </tr>
    <tr>
        <td>1</td>
        <td>Rod Stewart</td>
        <td>Maggie May</td>
    </tr>
</table>

</body>
</html>

Series Navigation<< HTML Table: Styling a table
HTML Table: Table background color >>