0

LWC datatable looks different in lightning and in Visualforce(lightning out). The LWC gets extra whitespace in classic. Also the alignment of 'view' button changes. We are working on transitioning to lightning and this will make the UI inconsistent and unappealing to classic users. I tried creating a datatable using code from Lightning Design System, but the results were same. Is this a salesforce bug? If yes, upvote this idea.


Lightning View

Lightning view


Classic View

Classic View


Column Definition

const columns = [
    {
        label: 'View',
        type: 'button',
        initialWidth: 50,
        typeAttributes: {
            label: 'View',
            title: 'View',
            variant: 'base',
            alternativeText: 'View',
            target:'_blank'
        }
    },
    { label: 'Label', fieldName: 'name', type:'text' },
    { label: 'Email', fieldName: 'email', type: 'email' , sortable:'true' },
    { label: 'Phone', fieldName: 'phone', type: 'phone', sortable:'true'  },
    { label: 'MDM ID', fieldName: 'mdm', type: 'text' , editable:'true' },
];

HTML

            <div class="slds-scrollable" style="height:20rem;width:67rem">
                <div style="width:120%">
                    <lightning-datatable 
                        key-field="Id"
                        data={wrappers}
                        columns={columns}
                        onrowaction={navigateToRecordViewPageClassic}
                        hide-checkbox-column="true">
                    </lightning-datatable>
                </div>
            </div>
  • Does this seem like a salesforce bug? – Koustubh Nov 6 '19 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.