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;
}