You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@AllenFang Trying to convert to your new version. Ran into this same issue - pretty much blocking us at this point. I was able to use headerStyle to set the width for now. Maybe that is the new way?
Reacted by allen, amit0001, gutimore, vikasa7, dilushi, Barry Lachapelle, Bender, J0rg3M3nd3z, 0Alic, Mohd Faisal and 56 more
Reacted by Minions and praneshkrsingh
Reacted by Avkaran Singh , José Enrique, Farida Wulandari, Daniel Golden, Rian Khanafi, shabeebcoder, ddumond, Alex Y Sanabria, kikeflowers, Bibek Sharma Chapagain and 2 more
Reacted by Amartuvshin, Vrajpal Jhala, Anton Snisarenko, Minions and Sadio Sangharé
Reacted by diguage, Rian Khanafi, sakshivicesoftware, ddumond, Alex Y Sanabria, Justin Johnson, Minions, Sadio Sangharé and praneshkrsingh
and due to this none of the proposed solutions are working. I can even see the classes being applied using Chrome Dev Tools. The issue, for me, is the default style applied to the wrapper class:
Using dev tools, if I remove that class, the table width adopts the values of the width parameters passes via to BS Tables. I need away to remove this class via the library. I have tried passing in null and a blank string to no avail.
I also apologize because I am not that savy with CSS and I am just learning React, so please excuse any ignorance. I have also read the documentation and could not find a solution.
with the help of this code I'm able to manage table header column size but not table cells size.
Even I applied css also on table ... help me out if any of you had solved this issue.
Hi there,
I am facing issue because I am using a table without header, it is hidden as below:
headerAttrs: {
hidden: true
}
As it is hidden, so my headerStyle is not working on it.
Is there any way, I can set width of table column without headerStyle and only using style :{} attribute or any other way.
Activity
AllenFang commentedon Feb 23, 2018
@YannisMarios #221
This is not implemented yet. I will enhance this feature ASAP, thanks.
waynebrantley commentedon Mar 5, 2018
@AllenFang Trying to convert to your new version. Ran into this same issue - pretty much blocking us at this point. I was able to use headerStyle to set the width for now. Maybe that is the new way?
AllenFang commentedon Mar 6, 2018
@waynebrantley right now,
headerStyleis just a way, I'm think other good solution for it. I apologize for this inconvenienceNorthshoot commentedon Mar 24, 2018
I think current implementation if great!
Just add to your column description and done.
waynebrantley commentedon May 31, 2018
@AllenFang so is headerStyle going to be how this is done? That is fine, might should put a storybook showing?
nthgol commentedon Jul 16, 2018
can anyone suggest a way to 'width - auto' size the columns according to the data?
AlessandroGambaro commentedon Aug 1, 2018
<BootstrapTable....>
<TableHeaderColumn width={'20%'} ....
<TableHeaderColumn width={'80%'} ...
pceccato commentedon Oct 3, 2018
Is there an example of how to set the column widths? This is fundamental functionality...
waynebrantley commentedon Oct 3, 2018
@pceccato See @Northshoot comment above...that is part of the column definition...works good.
pceccato commentedon Oct 4, 2018
Does it need to be an arrow function?
B-R-Bender commentedon Dec 20, 2018
No, you could use anonymous function declaration. Or any other you may like.
JenniferMarston commentedon Dec 20, 2018
Hi. I'm just starting to use the component, but the proposed does not work if we want the table to be responsive.
ehtasham89 commentedon Jan 6, 2019
how to set width in react-bootstrap-table2
let columns = [ { dataField: 'lastModified', text: 'Last Modified Date', width: "60" }, ]Its not working...
JenniferMarston commentedon Jan 6, 2019
lovato commentedon Mar 12, 2019
Response is above: #226 (comment)
It works.
8 remaining items
davidsonsns commentedon Jul 17, 2019
I just followed this reference and it worked for me react-bootstrap-table2 storybook Work on Header Columns - Customize Column Style
almog-kiki commentedon Jul 29, 2019
.react-bootstrap-table th[data-row-selection] {
width: 40px !important;
}
AlexPuga commentedon Sep 11, 2019
css
Table Rows Options:
headerStyle:{minWidth: '200px'}ddouglas commentedon Oct 26, 2019
I have no doubt that all of these solutions work flawlessly, however I am hiding the header row:
and due to this none of the proposed solutions are working. I can even see the classes being applied using Chrome Dev Tools. The issue, for me, is the default style applied to the wrapper class:
Using dev tools, if I remove that class, the table width adopts the values of the width parameters passes via to BS Tables. I need away to remove this class via the library. I have tried passing in null and a blank string to no avail.
I also apologize because I am not that savy with CSS and I am just learning React, so please excuse any ignorance. I have also read the documentation and could not find a solution.
Thank You.
awitherow commentedon Oct 30, 2019
is this going to be done (been about a year now) or just hacked?
Guiw5 commentedon Nov 12, 2019
@AllenFang @YannisMarios
I think it should be closed as it's solved by an alternative way to do it.
...as we said "it's not an issue is a feature"
ddouglas commentedon Nov 12, 2019
Add the bootstrap4 property and the header overrides I meantion above take effect.
Nandiniyadavraj commentedon May 4, 2020
hello there,
I checked on all possible way to increase column width as mentioned above but none of it work for me.
with the help of this code I'm able to manage table header column size but not table cells size.
Even I applied css also on table ... help me out if any of you had solved this issue.
Thanks.
AlexPuga commentedon May 4, 2020
Try it:
formatter: (col, row) => { return <span style={{display: 'block', width: 100, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis'}}>{col}</span> }Nandiniyadavraj commentedon May 4, 2020
It's really working. Thank you so much @AlexPuga
ChaitraK2000 commentedon Sep 5, 2020
Hi I am trying React-bootstrap-table. But i wanted to increase the width of header row. How can i do that?
Sharmistha24 commentedon Mar 23, 2021
Try this.
{
dataField: 'about',
text: 'About',
headerStyle: () => {
return { minWidth: '200px' };
}
}
tushar681 commentedon Jun 8, 2021
Hi there,
I am facing issue because I am using a table without header, it is hidden as below:
headerAttrs: {
hidden: true
}
As it is hidden, so my headerStyle is not working on it.
Is there any way, I can set width of table column without headerStyle and only using style :{} attribute or any other way.
Thanks in advance
istiak227 commentedon Jul 8, 2021
if nothing works, try this one. Worked for me. Cheers!