I have a lightning datatable with column as type number
The row value in it is getting right aligned, while everything else is left aligned, I need to make it uniform.
Here is what I tried —
<div class="empFamilyTable">
<lightning:datatable aura:id="accountTable"
keyField="Id"
hideCheckboxColumn="true"
columns="{!v.FamilyDetailColumns}"
data="{!v.FamilyDetailData}"
onrowaction="{! c.handleRowAction }"/>
</div>
CSS–
.THIS .empFamilyTable td {
text-align: left !important;
}
Best Answer
Number data types cell are aligned with css class slds-grid_align-end. It basically used to grow from the end of the horizontal axis. so if you override below style for slds-grid_align-end class then it will left align all number fields.
Refer SLDS guide for this.