# How do I freeze the first column and header row?

**URL:** <https://community.weweb.io/t/how-do-i-freeze-the-first-column-and-header-row/8957>\
**Category:** How do I?\
**Created:** [June 4, 2024, 6:09pm UTC](https://community.weweb.io/t/how-do-i-freeze-the-first-column-and-header-row/8957 "2024-06-04T18:09:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![edgar](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@edgar](https://community.weweb.io/u/edgar)\
**Post date:** [June 4, 2024, 6:09pm UTC](https://community.weweb.io/t/how-do-i-freeze-the-first-column-and-header-row/8957/1 "2024-06-04T18:09:53Z")

</div>

Hi. I’m hoping that I can get some help for my application. @Joyce  
I have 2 main questions.

1. How do I freeze the first column of my table?
2. How do I freeze the header row without it disappearing halfway through?

**Setup**

- Table is created using stack element (I need the ability for users to drag and drop rows so I chose this element)
- I had to move the header row outside of the stack element to get it to be sticky, but it disappears after vertical scrolling through the entire page
- For the section, I have a fixed width of 100% and a fixed height of 90vh (I want the scroll bars to show up in the page for users who don’t have a touchpad or mouse with horizontal scroll
- Table flexbox is set to 100% fixed width with height set to automatic

**Attempts**  
For question 1, I tried to make the first flexbox of the row sticky.  
For question 2, I tried adjusting the table height

Any suggestions are greatly appreciated. Thanks.

 ![Screenshot 2024-06-04 at 11.02.14 AM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/d/dcfbee90045ce1b4a833730274dacf899420fe8a.png)

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [June 4, 2024, 6:50pm UTC](https://community.weweb.io/t/how-do-i-freeze-the-first-column-and-header-row/8957/2 "2024-06-04T18:50:40Z")

</div>

I think @jptrinh made a video about this, or there is at least an answer from him with a solution.

---

<div class="post-metadata">

**Author:** ![jptrinh](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/jptrinh/32/1493_2.png) [@jptrinh](https://community.weweb.io/u/jptrinh)\
**Post date:** [June 4, 2024, 9:39pm UTC](https://community.weweb.io/t/how-do-i-freeze-the-first-column-and-header-row/8957/3 "2024-06-04T21:39:19Z")

</div>

> [@Freeze container on a horizontal scroll](https://community.weweb.io/t/freeze-container-on-a-horizontal-scroll/8514/3):
>
> Hey @enzocarmo Maybe it’s a bit late, but came up with a solution to freeze any column to the left, inside the Table component. I think adding position: sticky and left:0 would have done the trick, but with the auto-generated wrappers, it’s not working. Fortunately, we can still add some custom styling. This worked for me (add the style to an HTML embed to preview it in the editor) : \<style\> #myTable .ww-columns.ww-object-elem \> .ww-layout \> div:nth-child(1) { position: sticky; left…

> [@How can I set the headers of the "Tabs" element to position sticky?](https://community.weweb.io/t/how-can-i-set-the-headers-of-the-tabs-element-to-position-sticky/8916/2):
>
> You can target the tabs container with custom css. To preview these changes in the editor, you can put your style in an HTML Embed. Something like that worked for me: \<style\> .tabs-object .tabs-container[data-v-077c1ff4] { position: sticky; top: 0; } \</style\> The data-\* is probably specific to my component, but you can modify it with your own if you look at the Inspector panel or… you can just go with an !important statement… \<style\> .tabs-object .tabs-container { position: sti…

You can refer yourself to these posts above 🙂 Haven’t tried with the stack component but the logic should be close.  
Let us know if the solutions worked for you!

---

<div class="post-metadata">

**Author:** ![edgar](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@edgar](https://community.weweb.io/u/edgar)\
**Post date:** [June 6, 2024, 7:48pm UTC](https://community.weweb.io/t/how-do-i-freeze-the-first-column-and-header-row/8957/4 "2024-06-06T19:48:17Z")

</div>

Thank you. I’ll take a look and try it out.
