Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Unanswered

How to make the list header sticky when scroll

Like (0) ShareShare
ReportReport
Posted on 28 Feb 2023 05:01:43 by 105

Want to make the below highlighted list header section sticky on top when scrolling the page down, and tried to add the below CSS into the list table's th > tr element, but not working, is this doable in Power Pages?

 

style="position: sticky; top: 0; z-index: 1030; background-color: #fff!important;"

 

jwnz_0-1677560419518.png

 

Categories:
  • Fubar Profile Picture
    7,875 Super User 2025 Season 1 on 01 Mar 2023 at 05:02:54
    Re: How to make the list header sticky when scroll

    if 

    .entity-grid .view-grid

    is defined in one of the out of the box CSS files, then you may want to put !important at the end of each element inside that class (we have no control over the order that Web Files getting read in from the portals cache, so is possible the order changes with future updates etc so better to be safe than sorry)

  • jwnz Profile Picture
    105 on 01 Mar 2023 at 04:44:07
    Re: How to make the list header sticky when scroll

    Hi @Fubar ,

     

    I guess I have got it working by uploading the below custom CSS:

    /*! sticky header */
    .entity-grid .view-grid {
     overflow: auto;
     height: 600px;
    }
    
    .entity-grid .view-grid th {
     top: 0;
     position: sticky;
     background-color: #FFFFFF;
     z-index: 1000;
    }

     

    How to upload CSS file:

    https://learn.microsoft.com/en-us/power-pages/getting-started/tutorial-add-custom-style

     

    Thanks

  • Fubar Profile Picture
    7,875 Super User 2025 Season 1 on 01 Mar 2023 at 02:12:17
    Re: How to make the list header sticky when scroll

    I don't know how much luck you will have getting exactly what you want but in general:

    • You can't set sticky on tr tags you need to set them on each column heading th tag inside the tr e.g on each th apply   position: sticky; top:0;
    • You will also have to override other values, for the List there is a class that sits on a div higher in the DOM called "view-grid", this class contains values that will stop the sticky on the th e.g. in the Browser Console for a standard list without any filtering or search turned on etc just a plain list if you add the sticky settings to the column th tags and remove the view-grid class from the div you will see the column headings go sticky. (I will leave it to you to find out what other values you need to override)

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Pages - General Discussions

#1
WarrenBelz Profile Picture

WarrenBelz 9 Most Valuable Professional

#2
Rondel Profile Picture

Rondel 6

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 4 Most Valuable Professional

Overall leaderboard