title: Responsive datatables details icon conditional formatting
body: <p>I just want to change color of detail symbol color when datatable is collapsed on specific condition. Spend soo much time to do it</p>
  
  <p>here is my code:</p>
  
  <pre><code>&lt;table class="table table-striped table-bordered dt-responsive nowrap"&gt;
                      &lt;thead&gt;
                          &lt;tr&gt;
                              &lt;th&gt;Heading1&lt;/th&gt;
                              &lt;th&gt;Heading2&lt;/th&gt;
                              .
                              .
                          &lt;/tr&gt;
                      &lt;/thead&gt;
                      &lt;tbody&gt;
                             @{ 
                              int i = 1;
                              }
                             @foreach(var item in foo)
                              {
                              &lt;tr&gt;
                              &lt;td&gt;Data1&lt;/td&gt;
                              &lt;td&gt;Data2&lt;/td&gt;
                              .
                              .
                                 @if(item.cond == true)
                                 {
  &lt;style&gt;
  table.dataTable.dtr-inline.collapsed &gt; tbody &gt; tr:nth-child(@i) &gt; td:first-child:before {
  background-color: red;
  }
  &lt;/style&gt;
                                 }
                                 else
                                 {
  &lt;style&gt;
  table.dataTable.dtr-inline.collapsed &gt; tbody &gt; tr:nth-child(@i) &gt; td:first-child:before {
  background-color: white;
  color: blue;
  }
  &lt;/style&gt;
                                 }
                              &lt;/tr&gt;
                              i++
                              }
                      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/8j99s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8j99s.png" alt="enter image description here"></a></p>
  
  <p>looking work but when i'm try to search something or change the show entries count, it fails.</p>
  
  <p><a href="https://i.stack.imgur.com/OpgMw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OpgMw.png" alt="enter image description here"></a></p>
  
  <p>seems my pseudo class is fails on changes.</p>
  
  <p>my question is;
  how can i select the td without nth-child() or how can i asign this style to my td with id selector ?</p>