Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement first column as sticky when table scrolls horizontally #36

Open
prajapati-parth opened this issue Aug 28, 2017 · 5 comments
Open

Comments

@prajapati-parth
Copy link
Contributor

prajapati-parth commented Aug 28, 2017

Hi @AllenFang,
Making the first column sticky would really help when the table scrolls horizontally so that a reference to the rows can be seen while scrolling as the first column is generally used to hold the identifying element of a particular row data.

A similar example here

I've already implemented it in the fork of react-bootstrap-table. I think this would be a good feature for react-bootstrap-table2.

@AllenFang
Copy link
Member

Hi @prajapati-parth thanks for this suggestion, it's really useful when we have large columns. I'll consider to implement it when we finish the basic component structure in react-bootstrap-table2

Thanks

@sgwcollins
Copy link

sgwcollins commented Dec 7, 2018

@AllenFang is this feature implemented
?

@dailymp
Copy link

dailymp commented Jul 19, 2019

I will be waiting for this!!!

@kaleem-elahi
Copy link

waiting for this feature..

@pratikw-iprogrammer
Copy link

this worked for me thanks to AllenFang/react-bootstrap-table#723 (comment)

`.stickyFirstColumn {
/* style for the stick, fixed column*/
.react-bootstrap-table > table > tbody > tr > td:nth-child(1),
.react-bootstrap-table > table > thead > tr:nth-child(1) > th:nth-child(1) {
position: sticky;
position: -webkit-sticky;
left: 0;
z-index: 2;
}

/*keeping proper row & td colors */
.react-bootstrap-table > table > tbody > tr{
background-color: #fff;
td {
background-color: #fff;
}
&:hover {
cursor: pointer;
background: #f6f9fc;
td {
background-color: #f6f9fc;
}
}
}

/keeping columns aligned during scrolling/
.react-bootstrap-table {
max-width: 100%;
overflow: overlay !important;
}
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants