Reputation: 403
I have a table in which last two columns are fixed by position = sticky because I needed to remove them from scrolling. I need to put a dropdown list in one fixed column. But my dropdown list is going under the sticky element why this is happening? I tried to set z-index to dropdown list but it is not working can anyone tell me what is I'm missing
Upvotes: 2
Views: 3100
Reputation: 46
Generally the parent element of a dropdown will be position:relative and the content of the dropdown will have Position:absolute. So Position:sticky on a dropdown might not work.
Edit:
You cannot make a dropdown by using position:sticky; . But to solve your problem there is a way where you can stick your last two columns using position:absolute; and add a dropdown. Here's a jsfiddle that can help you
Click <a>https://jsfiddle.net/Akash951/q2sctfwz/</a>
Note: when you add a dropdown here make sure you use z-index more than the column so that the dropdown content comes on top.
Upvotes: 1