Search code examples
cssreactjssortingantd

When sort a column in antd Table component the color for sorting override my css


i sort a column in antd Table component and the entire column takes a default color. The problem is that i have custom css applied on my rows but when i sort them the default color of antd for sort override my custom css. I am writting reactjs

  <Table
    size='small'
    dataSource={this.state.codes}
    rowClassName={(record, index) => ((record.package_name===null ? 'disable' : ''))}
    columns={[  }]

My own css that applied to all the row is on the rowClassName What i want is to when i sort a column the default sort css not to be applied and override my custom css.


Solution

  • I have found a solution to my problem, the css selector that is responsible for sort in antd is this td.ant-table-column-sort. So inside my CSS file i have insert this code:

    .even > td.ant-table-column-sort {
       background-color: transparent;
    }
    

    Where even is my custom CSS