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

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -