react-bootstrap-table2 icon indicating copy to clipboard operation
react-bootstrap-table2 copied to clipboard

Dynamically resize column widths to fit all content

Open dnorrstrand opened this issue 4 years ago • 2 comments

Hello,

Is there any way to re-size table columns automatically based on their content's size? My table is currently formatted with all columns having equal widths while their contents differ in size. The result looks ugly because some content does not fit the column space completely and in other columns there is a lot of blank space:

Screenshot

applying style: { width: "fit-content" } does not work. Can you please help?

dnorrstrand avatar Mar 05 '21 19:03 dnorrstrand

@dnorrstrand I haven't had any trouble with my tables. Make sure you're including the styling in your file:

import 'react-bootstrap-table-next/dist/react-bootstrap-table2.min.css'

Also, get rid of any custom styling relating to column width that you put on. It may be interfering.

Also, Check our bootstraps responsive tables.

jklingen92 avatar Apr 16 '21 20:04 jklingen92

In this link You can find help https://github.com/react-bootstrap-table/react-bootstrap-table2/issues/1160

Fabian-Ojeda avatar Jul 17 '22 04:07 Fabian-Ojeda