0

I've tried this in two ways:

First:

component.set("v.columns",[
            {label:'', fieldName:'edit', type:'action', class: 'cols', cellAttributes: { iconName: { fieldName: 'utility:custom_apps' }}},
...
]);

Second:

<lightning:datatable data="{! v.data }"
        class="cols table"
        columns="{! v.columns }"
        keyField="id"
        resizeColumnDisabled="true"
        hideCheckboxColumn="true"/>
    </lightning:card>

But neither of it works. Is it possible at all?

If needed, I here is my CSS as well

.THIS .cols {
    background-color: #16325c;
    color: white;
}

.THIS .table{
     text-align: center;
}

1 Answer 1

4

This should not be super difficult give your datatable a class e.g. table-test then in a style section of a component add

.THIS .table-test thead th span {
background-color: #16325c;
color: white}

The result should be:

enter image description here

Bear in mind there are hover events that you also have to override.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .