Allow tables to fit to data width, not 100% of container
See original GitHub issueWhat problem does this feature solve?
At the moment, all Ant Design tables are 100% width; when the data is sparse, this makes them very spaced out, and it’s difficult to follow one row to see all the information. I’d like to add an option to the table to fit the data, not the container.
What does the proposed API look like?
A new property on the Table would probably work, something like width={data|full}
, with full
being the default.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Force HTML Tables To Not Exceed Their Containers' Size
I have a "dynamic" (percentage based) layout with two columns. .grid { width: 100%; box-sizing: border-box; } .grid > * { box-sizing: border-box...
Read more >table-layout - CSS: Cascading Style Sheets - MDN Web Docs
This example uses a fixed table layout, combined with the width property, to restrict the table's width. The text-overflow property is used to ......
Read more >How To Create a Full Width Table - W3Schools
Learn how to create a full-width table with CSS. A table that does not have a set width: Firstname, Lastname, Age. Jill, Smith,...
Read more >Flexible table width - DataTables example
This example shows a table with width="80%" and the container is also flexible width, so as the window is resized, the table will...
Read more >How to set fixed width for <td> in a table ? - GeeksforGeeks
By assigning a numeric value to this attribute between 0 to 100 in terms of percentage(or you can use pixel format). We can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Whats the solution for this. Ant Table is so annoying.
This could do the trick for you
ref: https://ant.design/components/table/#Table
perhaps with
ref: https://ant.design/components/table/#scroll