function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mike Tol 1Mike Tol 1 

Custom table with edit columns

I have accounts custom table. I need that The Account Name & Rating columns contain an Edit button that appears when hovering over the row. When you click on the Edit button, the cell data should be edited, while the rest of the Edit buttons should not respond to the click, should not be editable and so on until the user clicks cancel or save. Please tell me how can I do that.

    <lightning-card title="Account" >
        <table border="1" cellspacing="0" cellpadding="5" style="border-collapse:collapse;" class="tblColPad">
            <template for:each={} for:item="accountItem">
                <tr key={accountItem.Id}>
                        <lightning-button label="Edit" size="small" variant="neutral"
                        onclick={handleEdit} value={accountItem.Id}
                        icon-name="utility:edit" icon-position="right"
                    <td><lightning-button label="Delete" size="small" variant="neutral"
                    onclick={handleDelete} value={accountItem.Id}
                    icon-name="utility:delete" icon-position="right"

import { LightningElement, track, wire } from 'lwc';
import getAccounts from '@salesforce/apex/ProjectFour.getAccounts';
import {deleteRecord} from 'lightning/uiRecordApi';
import {refreshApex} from '@salesforce/apex';
import {ShowToastEvent} from 'lightning/platformShowToastEvent';
export default class ProjectFourCustom extends LightningElement {
  @wire (getAccounts) getAccount;
  @track recordId;
     this.recordId =;
     .then(() =>{
        return refreshApex(this.getAccount);
     .catch(error =>{
         window.console.log('Unable to delete record due to ' + error.body.message);

public class ProjectFour {
    public static List<Account> getAccounts() {
        List<Account> accounts = [SELECT Id, Name, Rating FROM Account Limit 3];
        return accounts;    
AnkaiahAnkaiah (Salesforce Developers) 
Hi Mike,

Refer the below links have solution.

If this helps, Please mark it as best answer.

Mike Tol 1Mike Tol 1
Thank you Ankaiah, but this links with datatable, not with custom table,,,