YoroDiallo YoroDiallo - 2 months ago 6
CSS Question

how to exclude last td from table-layout

I have a table with dynamic rows. When I add new row appears delete button. I use

table-layout
and when delete button appears this button size becomes like another td sizes. I try to add table width and this 'delete button' width (
table table-layout:fixed; width:100%
) but it not works, then I try to set width to button (
width:5%
) and again not works.
table-layout
so comfortable and I don't wanna to remove this property, but I have problem with it, where I'm wrong? Here is my Plnkr example..

UPD. I have table with
table-layout
and dynamic rows, at first screen displays default view
enter image description here
When I add new row I add "remove button". This button should be small but because
table-layout
'remove button' the same width with another rows:
enter image description here

Answer

If the question is about the style of the last column containing the delete button, I may suggest you to add in your css:

table, tr, td:nth-child(-1) {
     width: auto;
     border:none;
     margin: 1px;
}

The updated plunker