I have two tables that look identical:
<html>
<head>
<style>
td, th {
text-align: left;
padding: 28px;
}
</style>
</head>
<body>
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
<tr>
<td>Alex</td>
<td>Pieter</td>
</tr>
<tr>
<td>Jackson</td>
<td>Smith</td>
</tr>
</table>
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
<tr>
<td>Alex</td>
<td>Pieter</td>
</tr>
<tr>
<td>Jackson</td>
<td>Smith</td>
</tr>
</table>
</body>
I applied styling to all td
and th
tags. Is there a way to style just one table? I attempted to add a class to the table:
<table class="myClass">
and included it in the styles:
table.myClass, td, th
However, my attempts were unsuccessful. I tried different methods but none resulted in success.