topazt topazt - 4 years ago 108
CSS Question

css affecting all the tables in my site, how do avoid this?

my problem is that i have this css for 1 table But its affecting all the other tables i have on my site?

css code example:

tr:last-child td:last-child {
border-bottom-right-radius:3px;
}
/*effects map*/
td {
background:#555;


and some example html

<table class="table table-condensed table-striped">
<tbody>
<tr class="accordion-toggle">


<td class="firstColumn">data1</td>
<td class="secondColumn">data2</td>

Answer Source

Put a class on the table you want to apply this specific CSS and rewrite your css to look like this:

.mySpecialTable tr:last-child td:last-child {
  border-bottom-right-radius:3px;
}
/*effects map*/
.mySpecialTable td {
 background:#555;

More: https://coolestguidesontheplanet.com/getting-selective-css-styling/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download