0

I'm trying to create a table "With No Borders" using standard lightning-datatable of LWC.

I'm referring to the pieces of codes given in https://www.lightningdesignsystem.com/components/data-tables/#With-no-borders and https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/example.

One thing I have understood that I have to have to see the magic.

I tried accessing thead using this.template.querySelectorAll('thead')[0] and adding class in it as

        this.template.querySelectorAll('thead')[1].class="slds-assistive-text"; 

But I couldn't achieve the desired result. So can anyone please help me regarding it? Let me know what I'm missing, or is it not possible to achieve this at all.

Note: I have defined class="slds-table slds-table_cell-buffer slds-table_header-hidden" at data-table component itself.

0

You can't modify the internal components/state of a component except through their public APIs. As such, it's not possible to do what you're trying to do. You would need to build your own custom datatable implementation.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.