How to set lightning:datatable fixed column widths
You can use the initialWidth
property of the column to set the width when it is rendered. It can still be resized.
[
{ label: 'Message', fieldName: 'Description', type: 'text' },
{
type: 'button',
initialWidth: 34,
typeAttributes: {
iconName: 'utility:new_window',
name: 'newWindow',
title: 'Popout Window',
disabled: false,
value: 'test'
}
}
]