Looking for help with my HTML code - I want to make the header row of a table bold. Here's what I have:
<!DOCTYPE html>
<html>
<head>
<style>
table>tr>th {
font-weight: bold;
}
</style>
</head>
<body>
<table>
<tr>
<th>Amount</th>
<th>Name</th>
</tr>
<tr>
<td>5</td>
<td>orange</td>
</tr>
</table>
</body>
</html>
My CSS rule doesn't seem to be working, but changing it to table tr > th
fixes the problem. Can anyone explain why this is? As far as I know, the <tr>
is a direct child of the <table>
and the <th>
is a direct child of the <tr>
. What am I missing here?