jquery - css for particular table's rows and columns -


i have many html tables , 1 of these named "table1". want give style table only. used:

#table1 tr,th,td   {     border: 5px solid black;   } 

but when executed, other table's td , tr, th style setted same #table1 's style.

how can give style particular table's td , tr, th only????

you need specify parent th , td

#table1 tr, #table1 th, #table1 td {     /* ... */ } 

otherwise apply style

  • #table1 tr (all tr inside #table1)
  • th (all th no matter are)
  • td (all td no matter are)

as side note, on modern browser :any pseudoclass is available (with -moz- , -webkit- prefixes) implemented more consistently write

#table1 :any(tr, th, td) {    ... } 

useful avoid repetition.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -