I am working on a LWC component where in a lightning datatable I have more than 7-8 columns. When I add the component into detail section of a record page, the headers of the table is getting truncated. While I used wrapText: true, seems it only works on the data but not on the headers. Is there any way I can wrap the column names ? Thanks in advance. HTML:
<lightning-datatable
key-field="Id"
data={allConsdata}
columns={columnsCon}
hide-checkbox-column="true">
JS:
@track columnsCon = [
{
label: 'Contact/rep',
fieldName: 'nameUrl',
type: 'url',
typeAttributes: {label: { fieldName: 'Name' },
target: '_self'},
sortable: true,
wrapText: true
},
{
label: 'Title',
fieldName: 'Title',
type: 'text',
sortable: true,
wrapText: true
},....