Color of Row selection when background of cell is changed

Color of Row selection when background of cell is changed

ArgaWoWArgaWoW Posts: 14Questions: 5Answers: 0

I have changed the backround of some cells with differnt colors based on some conditions.

The problem is, the row selection color not working on this cells.

I have add an important style in the html-file wíthout success.

Attached the link to a fiddle

jsfiddle.net/fm5br2Lx/5/

Thank you for helping me

This question has accepted answers - jump to:

Answers

  • colincolin Posts: 15,144Questions: 1Answers: 2,586
    edited February 2021

    To be clear, do you want the whole line to be the same colour when the selection is made, regardless of the colour of any of the cells?

    Colin

  • ArgaWoWArgaWoW Posts: 14Questions: 5Answers: 0

    Hi Colin,
    thank you for your answer :)

    yes, that's exactly what I want to have.

    The complete row should have the color;

    background-color: #255

    Andreas

  • allanallan Posts: 61,726Questions: 1Answers: 10,109 Site admin
    Answer ✓

    Hi Andreas,

    You were using table.dataTable tbody tr.selected as the selector for the row background, but then assigning a background colour to specific cells. That would result in the row background being behind the cell.

    Use:

    table.dataTable tbody tr.selected td 
    

    as the selector. http://jsfiddle.net/CloudTables/kg7phoz0/1/

    Allan

  • ArgaWoWArgaWoW Posts: 14Questions: 5Answers: 0

    Hi Allan,

    thank you. That works great.
    Do you have also a solution for the hover seletion of the row. The colored cells not get highlighted on hover?

    Andreas

  • colincolin Posts: 15,144Questions: 1Answers: 2,586
    Answer ✓

    The same principle would apply there - see here:

    http://jsfiddle.net/qa90w2vr/
    Colin

This discussion has been closed.