ngduc / react-tabulator

React Tabulator is based on tabulator - a JS table library with many advanced features.
https://codesandbox.io/s/0mwpy612xw?module=/src/components/Home.js
MIT License
366 stars 83 forks source link

Having an Issue with getting column headers to stretch to fit data #255

Open ameshkin opened 2 years ago

ameshkin commented 2 years ago

Title

Environment Details

Long Description I need the columns to stretch no matter how many characters there are. There should be horizontal scrolling. The rows are getting these hard coded styles min-width: 40px; width: 139px; height: 56px;

I upgraded from 4 to 5 and now this has broken. In the old table which was version 5, the width gets calculated as 200px. I've spent hours on this and it just doesn't make sense. I've tried several things.

        <ReactTabulator
          data={data}
          columns={columns}
          tooltips
          renderHorizontal='virtual'
          // layout="fitDataTable"
          // responsiveLayout="hide"
          // TRIED THESE frozen, fitColumns, fitDataFill, fitDataStretch
          // options={options}
        />

Screen Shot 2022-03-07 at 11 54 40 AM

damenking commented 1 year ago

@ameshkin did you ever figure out a solution to this by chance? I'm facing the same issue.

damenking commented 1 year ago

I was only able to get it to do what I wanted by having an outer container for the table with width: fit-content but this unfortunately doesn't work with the horizontal virtual dom rendering assuming that works with react-tabulator.