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

Column width broken when resize window

Open SunJang opened this issue 10 years ago • 9 comments

If the table has selectRow property, it breaks column layout when trying to resize window.

<BootstrapTable data={advertisersList} striped={true} hover={true} condensed={true} selectRow={selectRowProp} search={true} pagination={true} exportCSV={true} >
            <TableHeaderColumn dataField="ID" isKey={true} dataAlign="center" dataSort={true}>ID</TableHeaderColumn>
            <TableHeaderColumn dataField="Name" dataSort={true}>Name</TableHeaderColumn>
            <TableHeaderColumn dataField="Email" >Email</TableHeaderColumn>
          </BootstrapTable>

2015-12-08 5 17 46

SunJang avatar Dec 08 '15 08:12 SunJang

@SunJang, which version of react-bootstrap-table did you used?

AllenFang avatar Dec 08 '15 08:12 AllenFang

@AllenFang I use 1.3.0 for now but earlier versions have same problem. (1.2.10, 1.2.9)

SunJang avatar Dec 09 '15 00:12 SunJang

@SunJang, did you re-import the css files?when you upgrade to the new version, you should better to import react-bootstrap-table css again. Anyway, I can't reproduce this problem on v1.3.0, did you find any logs on console?

AllenFang avatar Dec 09 '15 01:12 AllenFang

@AllenFang Yes, I re-imported css files. And there is no log message appears on console related this issue. I think you can find similar problem on http://allenfang.github.io/react-bootstrap-table/example.html

if you increase width of the browser window, you can find broken column layout.

2015-12-09 11 08 30 2015-12-09 11 08 37

I tested on Chrome(46.0.2490.86) and Safari 9.0.1(11601.2.7.2) . It happened on both browser. any hints?

SunJang avatar Dec 09 '15 02:12 SunJang

@SunJang, probably like you said, the scenario is

  1. open a smaller windows
  2. render table
  3. increase the size of windows
  4. got this problem

I'll spend some time to fix this issues, thanks!

AllenFang avatar Dec 09 '15 03:12 AllenFang

@SunJang, fix it on v1.3.1 :)

AllenFang avatar Dec 12 '15 06:12 AllenFang

@AllenFang Awesome!! Thank you!

SunJang avatar Dec 15 '15 00:12 SunJang

I am still observing this issue, the cells are different sizes if I use a zoom other than 100% (either zooming in or zooming out):

screen shot 2015-12-26 at 12 37 00 pm

This is Chrome (latest) on OSX using 1.3.3 and as you can see, this happens whether or not the component needs to have a horizontal scroll.

It seems playing around with the size of the header fonts versus the td fonts affects how bad this gets. Does this library require using certain sizes of fonts, styling of fonts (px vs. ems), etc. or should it be able to handle this?

robwise avatar Dec 26 '15 20:12 robwise

@robwise, your problem is different with this issue, because you use zoom in&out rather than sizing windows. Anyway, it seem like a bugs that we can improve

AllenFang avatar Dec 27 '15 08:12 AllenFang