简体   繁体   English

固定列表之类的结构

[英]Fixed column table like structure

I want to create a table like structure without using table,tr,td etc tags. 我想创建一个不使用table,tr,td等标签的结构表。 The table should have its first column and headers fixed. 该表应固定其第一列和标题。 I have fiddled it under this URL: http://jsfiddle.net/RtfZu/ . 我在以下URL上摆弄了它: http : //jsfiddle.net/RtfZu/

I am not able to create a vertical scroll-bar, which upon scrolling should scroll the frozen column too. 我无法创建垂直滚动条,滚动时也应滚动冻结的列。

Any insights? 有什么见解吗?

You need to make your .table-body-scroll div scrollable. 您需要使.table-body-scroll div可滚动。 In the fiddle it breaks due to the a width issue causing a double scroll bar, but you should be able to fix that by adjusting the width and setting the overflow-x to hidden 在小提琴中,由于宽度问题导致双滚动条破裂,但您应该能够通过调整宽度并将overflow-x设置为隐藏来解决此问题。

.table-body-scroll
{    
    overflow-y:scroll;
}

http://jsfiddle.net/RtfZu/3/ http://jsfiddle.net/RtfZu/3/

Try adding overflow-y: auto; 尝试添加overflow-y: auto; and define a height to your .table element. 并为.table元素定义一个height This should scroll the entire table 这应该滚动整个表格

By the way, i have created a jQuery plugin that would render table using tags. 顺便说一句,我创建了一个jQuery插件,该插件将使用标签渲染表。 The table is configurable too. 该表也是可配置的。 code4devs.com is the URL URL是code4devs.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM