How to show edit and delete buttons in single column in lightning datatable

521 views Asked by At

I have requirement to show edit and delete button in single row rather than two different rows in lightning datatable of lwc.

Currently it is displaying as shown below

enter image description here

Instead of this want to display under one column like Action and have those buttons next to each other.

Also I dont want them in as shown below as it will result in increase in number of clicks

enter image description here

How can I achieve it?

Below is the code snippet for current scenario been showing up enter image description here

{
   label:'Edit',
   type:"button-icon",
   typeAttributes:{
      name:'Edit',
      title:'Edit',
      iconName:'utility:edit'
   }
},
{
   label:'Delete',
   type:"button-icon",
   typeAttributes:{
      name:'Delete',
      title:'Delete',
      iconName:'utility:delete',
      iconClass:'slds-icon-text-error'
   }
}
0

There are 0 answers