Forum Moderators: not2easy
I have a table within a table. The external table has class settings that control how the individual cell and row borders display.
Within a cell I have another table but I do not want it to inherit the values of the table it is in. I have tried to set the inside table to its own class with different settings but it did not work. I would think this could be done, but haven't quite been able to find the solution.
Any help with this is appreciated.
--Rick
<table border="0" class="myclass">
<tr><td>
<table border="0" cellpadding="4" cellspacing="4">
<tr><td>Some Text</td></tr>
</table>
</td></tr>
</table>
Having said that, you should be able to counteract everything higher on your style sheet by duplicating rules with different values. Usually something is just being overlooked.
Also, different browsers often display different results and may need two different rules to accomplish the same thing (padding, margin etc). Happy tweaking!
.myclass td table td { padding: 6px; background-color: #ffffff; }
?
Something else is afoot though, if you assigned a second class to the inner table, it should have worked.
.myclass td { padding: 12px; background-color: #ff0000; }
.innertable td { padding: 6px; background-color: #ffffff; }
<table border="0" class="myclass">
<tr><td>
<table class="innertable" border="0" cellpadding="4" cellspacing="4">
<tr><td>Some Text</td></tr>
</table>
</td></tr>
</table>
I just tested both of these and they work as expected, are you using a valid document type?