# Fixed when scrolling vertically, but not when scrolling horizontally

**URL:** https://forum.kirupa.com/t/fixed-when-scrolling-vertically-but-not-when-scrolling-horizontally/182840
**Category:** web dev
**Created:** [March 21, 2006, 9:34pm UTC](https://forum.kirupa.com/t/fixed-when-scrolling-vertically-but-not-when-scrolling-horizontally/182840 "2006-03-21T21:34:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bmorrise](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@bmorrise](https://forum.kirupa.com/u/bmorrise)
#### Post date: [March 21, 2006, 9:34pm UTC](https://forum.kirupa.com/t/fixed-when-scrolling-vertically-but-not-when-scrolling-horizontally/182840/1 "2006-03-21T21:34:13Z")

</div>

I am working on creating a spreadsheet type widget for a website I’m creating and I can’t figure out how to make the column headers fixed when scrolling vertically, but still allow them to scroll horizontally. An example of this is at  
[http://www.activewidgets.com/](http://www.activewidgets.com/). Does anyone here know how to do something like that? I can keep something at the top like that using JS, but it looks all choppy. I just used a window.onscroll event, but it doesn’t look so hot. I think that this is probably just some sort of CSS trickery. Any ideas? Thanks.

-B
