DataTable resizable columns glitch when using striped rows

UI Components for React
Post Reply
Master_T
Posts: 14
Joined: 13 Dec 2021, 11:57

27 Jan 2022, 12:30

Hi

I have a data table where I have enabled stripedRows and resizableColumns, with columnResizeMode="expand".

The problem I'm having is that when I resize columns, the color stripe on alternate rows does not get resized, so I end up with stuff like this:

Image

How do I fix this? Here's the source for my DataTable:

Code: Select all

<DataTable ref={(el)=> this.dt = el} value={this.state.dataTable.rows} filterDisplay="menu" showGridlines resizableColumns columnResizeMode="expand"
                                scrollHeight={this.state.tableHeight} responsiveLayout="scroll" scrollable autoLayout={true} size="small" stripedRows >
                        {this.getTableColumns()}
                    </DataTable>

Master_T
Posts: 14
Joined: 13 Dec 2021, 11:57

27 Jan 2022, 12:55

Ok, I found the problem: in my CSS I was applying the color on the tr.p-row-odd elements, instead if I apply it to the inner td elements it works, problem solved.

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests