看此帖:http://blog.csdn.net/chinmo/archive/2008/04/24/2322158.aspx 通过样式表来实现固定表头和列。效果确实不错。但是对于其中的疑问和问题这里需要补充一下。原文中设了三个样式,FixedTitleRow标题行(TR)的样式,FixedTitleColumn标题列(TD)的样式及FixedDataColumn数据列(TD)的样式;在这三种样式中都统一设置position属性为relative,这个设置是非常重要的,relative的解释说明是这样的:
Setting the property to relative places the object in the natural HTML flow of the document, but offsets the position of the object based on the preceding content. (设置HTML文档中的对象属性为relative时,其位移是相对于前面内容对象的)
也就是说那些固定列头的位置(left,top)是在当前所在的位置的基础上偏移