Changing column width in react-table

In react-table v7 you need to use a layout hook (useBlockLayout, useAbsoluteLayout or useFlexLayout) so the specified width is applied. Important: all those hooks set a default column width to 150px. You can see an example in Full Width Resizable Table. In react-table v8 you can use the attributes size, minSize and maxSize on the … Read more

How to show and hide some columns on React Table?

In column there is a property show. show: true, // can be used to hide a column. Make it false to hide the particular column. Keep user’s check-box values in the state. https://react-table.js.org/#/story/readme Note: The column property showis deprecated. Use initialstate.hiddenColumns instead. Check: https://github.com/tannerlinsley/react-table/issues/1804

Export to CSV button in react table

Take a look at this npm library – https://www.npmjs.com/package/react-csv For example – import {CSVLink, CSVDownload} from ‘react-csv’; const csvData =[ [‘firstname’, ‘lastname’, ’email’] , [‘John’, ‘Doe’ , ‘john.doe@xyz.com’] , [‘Jane’, ‘Doe’ , ‘jane.doe@xyz.com’] ]; <CSVLink data={csvData} >Download me</CSVLink> // or <CSVDownload data={csvData} target=”_blank” />

Select row on click react-table

I found the solution after a few tries, I hope this can help you. Add the following to your <ReactTable> component: getTrProps={(state, rowInfo) => { if (rowInfo && rowInfo.row) { return { onClick: (e) => { this.setState({ selected: rowInfo.index }) }, style: { background: rowInfo.index === this.state.selected ? ‘#00afec’ : ‘white’, color: rowInfo.index === this.state.selected … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)