html - Different style to column in table -
i trying give different style last column of table, have no idea how can this. added column <th>buy</th>
, it's working normal other <th>..</th>
give different style last column. tried write <th th-1>buy</th th-1>
no effect. please, if has idea share :)
here code:
<table id="example" class="display" cellspacing="0" width="100%"> <thead> <tr> <th>name</th> <th>position</th> <th>rating</th> <th>salary</th> <th th-1>buy</th th-1> </tr> </thead> <tfoot> <tr> <th>name</th> <th>position</th> <th>rating</th> <th>salary</th> <th th-1>buy</th th-1> </tr> </tfoot> <tbody> <tr> <td>tiger nixon</td> <td>def</td> <td>61</td> <td>$320,800</td> <td><div class="checkbox pull-right"> <label> <input type="checkbox"> buy player </label> </div></td> </tr>
what style need? can make want css:
.display td:last-child, .display th:last-child { background-color: green; }
with code, see last column in green background.
Comments
Post a Comment