My index.html file looks like this..
<table class="tablecontainer">
<table id="table1"></table>
</table>
My styles.css file looks like this...
.tablecontainer #table1 th, td {
border: 1px solid #ddd;
border-collapse:collapse;
font-family:"Open Sans";
font-size: 30px;
}
.tablecontainer #table1 tr:nth-child(even) {
background-color: #fff;
font-family:"Open Sans";
font-size: 12px;
}
.tablecontainer #table1 tr:nth-child(odd) {
background-color: #eee;
font-family:"Open Sans";
font-size: 12px;
}
.tablecontainer #table1 th {
background-color: grey;
color: white;
text-align: left;
font-family:"Open Sans";
font-size: 16px;
}
.tablecontainer #table1 tr:hover {
background-color: #cce6ff;
}
I can confirm that the styles for other things like buttons, headers, etc are being picked up correctly from my styles.css file.
However, the styles for my table are not being picked up (none of the styles I've written up in the styles.css are being inherited for the table.
I'm new to html/css in general.
EDIT (to the original question):
<div class="tablecontainer">
<table id="table1"></table>
</div>
<script>
...
var trHTML = '';
trHTML += '<tr><th>...</tr><th>';
...
$('#table1').append(trHTML);
</script>