Skip to main content

Improve the New Position Sticky Implementation


Show first post

52 replies

Marcus Fridholm

One important use case of sticky is to stick headers to the top and side in a table. While there are caveats, this is pretty easy to do in html/css, but right now it seems impossible in figma.

Wanted behavior:

  • Top/bottom row(s) stick to the top/bottom of the parent.
  • Left/right columns stick to the left/right side of the parent.

Consider building something like a timetable, where you want the trip number to be on top, and the stops to be on the left. If there’s a lot of trip and stops, the table can be far larger than the viewport, and you don’t want to lose track of which time corresponds to which stop, and likewise which trip each column represents.

Fairly simple to do in html/css, or in just about any spreadsheet application.


john-mainboard

Here is my solution. Nasty to setup:

 

 

 

  • If you already have a header that’s sticky or floating, then you have to add that header height to the table header so it sticks below that. 
  • So I added an auto layout to the header with a top padding of 100px. 
  • The header is made sticky (which includes this padding)
  • The auto-layout must be changes so that FIRST ON TOP (under the settings icon next to auto layout).
  • Then it will only stick while the table is being scrolled on the screen. 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings