Wrong header items width
The table header's width is not calculated the same way as the table's body, ending up in situations like this (note the header overflowing on the right):

[Edit: actually it happens even without this, see below] It happened because the bar on the left appears after a transition, and the whole layout re-rendered accordingly but the header did not.
[Edit: just missing CSS files] Also probably related: the width of a menu item is calculated before the sorting arrows are placed, which can produce this:

I could solve this by setting the width property, but I don't want fixed with, and no minWidth prop is available.
@jdelafon, first of all, you forgot to add the css of react-bootstrap-table. you can find it under the dist folder. If the problem still there, feel free to tell me :)
Indeed, thanks, it works now. I naively thought npm would do that, but I had to add it to the webpack config entry points.
Actually with the CSS added there is still an issue: instead of being shifted, one header item completely disappeared. If I remove the side bar, it works fine.

Redimensioning the window fixes it, but after each page reload the last item disappears. So there is still a refresh missing somewhere.
And this is with a classic 2-columns layout, no more animation, no added css. : the column headers are misplaced (N.B. overflow: hidden):
Small window size:

Large window size:

Edit: For some reason, according to changes I can make in dev tools, if there was no "width" not "min-width" properties to the th element, it would work just fine.
Edit: And it is written in the "style" prop instead of in the CSS of a class, which makes it untouchable. I think a flexbox design would do that just fine, too.
It gets fixed when I just resize the window, but breaks again on page reload.
For some reason, according to changes I can make in dev tools, if there was no "width" not "min-width" properties to the th element, it would work just fine.
you means no any width or min-width on <TableHeaderColumn>?
And it is written in the "style" prop instead of in the CSS of a class, which makes it untouchable. I think a flexbox design would do that just fine, too.
Sorry, I cant get you, any example or detail explanation?
BTW, what's browser and version you use? if you use newest chrome, there's known unalign issues.
if you can, maybe a repo give me to reproduce this issue is good, sometimes, this unalign problems is hard to reproduce on my local.
Thanks :)
I tried the latest Chrome and Firefox. I had to remove both width and min-width to get a normal layout in Chrome devtools, "element.style" section. I meant that using the new flexbox CSS properties, these sizing issues may go away. I will try to make an minimal example but it will take some time.
that's ok, take your time. I'll keep to figure out
Here is a short part of my app reproducing the issue.
The archive contains a complete project. Run "npm install", then "node run start" and go to localhost:3000.
I fail to understand what is special in this example, because I saw it happen without this react-sidebar component, but I can't reproduce yet. But at least it should point out differences between the body rows and the menu row with respect to layout.

The root component is in /pages/projects/index.js and the sidebar in /components/Layout/Sidebar/Sidebar.js.
@jdelafon, thanks you 👍
Hey @AllenFang @jdelafon, I'm also having a similar issue. I've included the CSS, but it seems the issue is in the JS calculation of widths (it sets inline styles).
The widths are wrong:

Here's what my table looks like:

@thienanle, what's your browser and version? any simple repo for me to reproduce this issue? Thanks
@AllenFang I'll set something up. I'm on Chrome version 54.0.2840.71 (64-bit)
May be useful information: when I resize my browser, the widths get re-calculated correctly.
Ah my mistake, it's happening to me because I didn't include the bootstrap css file. Probably unrelated to OP's issue.
edit: still having the issue after adding bootstrap css, it is the same issue as OP's.
@jdelafon We have the same setup (using React Static Boilerplate). It seems the issue stems from the CSS being applied after JS runs. JS runs in order to calculate header item widths, and since the CSS hasn't been applied yet, it calculates the wrong widths.
I believe this isn't an issue with react-bootstrap-table, but with our setup or perhaps React Static Boilerplate.
@thienanle Good point. But I'd argue that since we can make every other component work, including the table's body itself, why should the table's header not scale correctly?
Isn't the CSS always applied after, especially with css-modules/postcss?
@jdelafon The table body doesn't have any widths applied to it from JS (at least in my setup). It is dynamically sized per the default behavior of HTML tables.
CSS isn't always applied after. I think this has something to do with webpack's loading of modules. From what I know, the chunks all load asynchronously, so there's no way to know if the CSS loads before or after. I think switching the CSS loading to synchronous should solve our issue.
@thienanle That suggests that there is a way to calculate proper widths without JS, among which the now all-browsers-compatible CSS3 "flexbox", or a "display: table/table-row/table-cell" pattern. I am quite sure that Facebook's "fixed-data-table" module uses flexbox for that.
@thienanle, you are right, react-bootstrap-table will calculate and set the width on column for aligning header and body(Actually, header and body are two separate tables).
@jdelafon, yes, there's some people who suggest me to use flexbox, but base on Bootstrap, I need to study more to think about how to use flex with bootstrap.
BTW, because I want to make the vertical and horizontal scroll available on bootstrap table, I just make a table as two separated table for header and body, so I need the other effort to align them.
so if any idea or any simple html + css to implement bootstrap table with scrollable, feel free to discuss with me :)
Forgot something, you said you use React Static Boilerplate and cause this problem, but why and where's make this unalign issue?
@AllenFang
It seems the issue stems from the CSS being applied after JS runs. JS runs in order to calculate header item widths, and since the CSS hasn't been applied yet, it calculates the wrong widths.
It's not necessarily the boilerplate's issue, but the way webpack loads the modules. I think since they're all loading asynchronously, there's no guarantee that CSS loads before JS.