I have two tables, one with the id =’data’. My question is that i want to apply the below border properties for the table id=’data’ only but from the below code the css is being applied to both the tables.How to correct this
<style>
table
{
border-collapse:collapse;
}
table#data,th,td
{
border:1px solid black;
}
</style>
this should work:
because with
tablein the CSS selector You’re gonna call all tables, unless You specify a class liketable.class { ... }😉// edit
ok, i have to say:
will work also…
the main thing is, that You specify the ID or class of Your desired element in the CSS to get Your style applied to Your desired element…