0

I am having the spitted header angular material table and I was looking for help to add the sticky header.

I have tried to using sticky: true but somehow it is not working for my first column (as I am hiding the column.) And for the first rows. It is showing the second row.

Below is my table

enter image description here

When I go with the dropdown only these headers get sticky behavior than others. enter image description here

Below is my stackblitz.

https://stackblitz.com/edit/angular-bklajw-5foa62

1 Answer 1

1

To make the top header sticky add sticky tag in that as well. It will also fixed first column sticky issue.

 <tr mat-header-row
     *matHeaderRowDef="['header-row-first-group','header-row-sec-group','header-row-third-group','header-row-forth-group','header-row-fifth-group'];sticky:true">
</tr>

Demo

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks a lot, is it working in internet explorer and edge?
Working i chrome and edge have not tested in other browser, requesting you to please test yourself for all edge cases.
Sure. Will check and update you. Thanks a lot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.