I add via js to the end one more td with position: absolute . The tr itself has position: relative , but this last td positioned from the common window, and not from tr .

How to make it so that this cell is positioned from its parent tr ?

 <tr class="dif_color"> <td class="link_a"></td> <td class="link_a"></td> <td class="link_a"></td> <td class="link_a"> <button type="button" class="btn_accept" data-id="1098">ACCEPT</button> <button type="button" class="btn_decline" data-id="1098">DECLINE</button> </td> </tr> 

    3 answers 3

    Everything is in place:

     tr { position: relative; } .add { position: absolute; } 
     <table> <tbody> <tr class="dif_color"> <td class="link_a">Lorem</td> <td class="link_a">Lorem</td> <td class="link_a">Lorem</td> <td class="link_a"> <button type="button" class="btn_accept" data-id="1098">ACCEPT</button> <button type="button" class="btn_decline" data-id="1098">DECLINE</button> </td> <td class="add">add</td> </tr> </tbody> </table> 

      In your case, add the display:block property for tr .

        According to the answers already given :

        This is because it is relative to table elements is undefined. Which essentially means that we cannot add this parameter to our display: table.