---
title: "CSS 固定表头和列"
author: "Andy_Dou"
date: "2010-03-14T04:00:42Z"
tags: []
categories: ["Web前端"]
slug: "css"
draft: false
lastmod: "2010-03-14T04:05:34Z"
id: 615036
url: "https://ideabean.iteye.com/blog/615036"
---

```
 <style>
        .FixedTitleRow {
            position: relative; 
            top: expression(this.offsetParent.scrollTop); 
            z-index: 10;
            background-color: #E6ECF0;
        }      
        .FixedTitleColumn {
            position: relative; 
            left: expression(this.parentElement.offsetParent.scrollLeft);
        }       
        .FixedDataColumn {
            position: relative;
            left: expression(this.parentElement.offsetParent.parentElement.scrollLeft);
            background-color: #E6ECF0;
        }  
</style>
```