I have a table on React (Using AntD); but it doesn't matter for the question...
The issue is, that I want that cells of a specific column render text inputs... that this it's fine.
But, if I render only text inside the td
element, the HTML table auto-width the column based on the longest value in the table... but if I render an input
the auto-width doesn't work.
I don't want to fix the column width (using px or %); I want the column with the inputs
auto-growth depending on the longest value in the cells.
Here is the code:
https://codesandbox.io/s/keen-browser-v54fh?file=/src/columnsRender.js
This is a screenshot:
This is another example:
In the first example; looks almost good... In the second; it's so much space in the first column (The second column fits perfectly based on the data or in the header).
So, it's possible that a td
element understand the width of an input
element and automatically fixes the width of the column in the table?
Or exists any workaround?