I am trying to make my header sticky with overriding css with "Top:0" it seems to be over written by something else. I did try !Important but nothing seems to help.
-
Please provide enough code so others can better understand or reproduce the problem.Community– Community Bot2022-09-21 16:11:01 +00:00Commented Sep 21, 2022 at 16:11
-
By what is it being overwritten if you look at the header using DevTools?IT goldman– IT goldman2022-09-21 17:38:02 +00:00Commented Sep 21, 2022 at 17:38
Add a comment
|
2 Answers
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 tag.
2 Comments
Ankita
Hi Santosh, Thank you so much for your answer. I checked that my div already has slds-table--header-fixed_container : And My table already has slds-table--header-fixed How do I add slds-cell-fixed to class tag ? I have a css file in static resources to override existing CSS. I am new to SF front end. I would really appreciate your help
Ankita
The Div of cell already has the slds-cell-fixed: class . I am using chrome dev tool to see what else could be over writing it. But I don't see anything else.
Please try like this. It works.
<template>
<div style="height: 300px;">
<lightning-datatable
key-field="id"
data={data}
columns={columns}>
</lightning-datatable>
</div>
</template>
1 Comment
Community
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.