There is common scenario to freeze the table header and providing scrollbar to table body. This can be achieved by using standard slds classes no need to add custom CSS for that.
You have to use below mentioned slds classes:
You have to use below mentioned slds classes:
- slds-table--header-fixed_container : add this class on div by specifying the height for div
- slds-table--header-fixed :add this class to table
- slds-cell-fixed: add this class to <th> tag.
I have created a sample to display account list in data table inside slds card. Please find below sample code:
Hope this will help!!!
I like this article on salesforce lightning tips and tricks. Thanks for sharing Salesforce Online Training
ReplyDeleteVery helpful
ReplyDeleteWhat if I have a lot of fields, only the visible field will stick. How can I achieve scrollable on x-axis? Thank you
ReplyDeleteI also have the same requirement.
Deletesad
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteIf I Put this table in grid the header content gets compressed and not wrapped. Do you have any idea how to do that
ReplyDeleteWhat if we are using ligthing datagable, not html table
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteDo you need a software spy someone?How to read someone’s text messages without installing software on their Phone?
ReplyDeleteYou can visit here and use it.You can spy on other people’s chats, call logs, and multimedia files without letting them know