Background color Header Datagrid 2

0
hey community, second and last try. Can i add individual background colors for the header of a specific column in a datagrid2? As an example header for column 1 and 2 should be blue, for column 3 green and column 4 red. I know that I can give the whole header (over all columns a background color, but not like individual...). Can someone help me here?
asked
1 answers
1

Sure you can. Add a name to your datagrid’s class-property, say ‘headercolors’ and in your scss add:

    .headercolors .table .table-content .tr {
        .th:nth-child(1){
            background-color: red;
    }
        .th:nth-child(2){
            background-color: green;
    }
        .th:nth-child(3){
            background-color: blue;}
    }

That will give you:

More info here: https://docs.w3cub.com/css/:nth-child

answered