AllenFang / AllenFang/react-bootstrap-table

Column width changing when I change size per page

Đang mở
#1,972 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
2.2k
Fork
761
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hey I've been having some trouble with custom column width recently. Every time I click to change how many rows per page I see, my table columns change width increasing the size of the first columns while shortening the last ones. I'm creating the table fields dinamically and passing the width params through the element props, It could maybe one of the reasons.

Piece of my code:
Object used to create the table
`
this.tableFields = [

{dataField: "id", label: "Id", isKey: true, dataSort: true, width: '4'},
{dataField: "plate", label: "Placa", dataSort: true, width: '7'},
{dataField: "brand", label: "Marca", dataSort: true, width: '15'},
{dataField: "model", label: "Modelo", dataSort: true, width: '26'},
{dataField: "year", label: "Ano", dataSort: true, width: '5'},
{dataField: "emergency-contact", label: "Contato de Emergência", dataSort: true, width: '20'},
{dataField: "emergency-phone", label: "Telefone de emergência", dataSort: true, width: '13'},
{dataField: "plan", label: "Plano", dataSort: true, width: '10'},
`
]

Table creation

`
return(


{
this.props.tableFields.map((column, index) => {
return (

{column.label}

)
})
}

`)

Desired result
![captura de tela 2018-05-29 as 09 26 31](https://user-images.githubusercontent.com/22826013/40658710-7a593708-6322-11e8-8e3e-ecf8e0ec2910.png)

Output result after several size per page changes
![captura de tela 2018-05-29 as 09 26 50](https://user-images.githubusercontent.com/22826013/40658724-8522e83c-6322-11e8-9a5c-296f5790f4b0.png)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.