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

[css-tables][css-position] sticky cols #3577

Closed
inoyakaigor opened this issue Jan 31, 2019 · 4 comments
Closed

[css-tables][css-position] sticky cols #3577

inoyakaigor opened this issue Jan 31, 2019 · 4 comments

Comments

@inoyakaigor
Copy link

inoyakaigor commented Jan 31, 2019

I want to suggest an idea that can help to display large tables: sticky position for table columns (for easy horizontal scroll). It is basic functionality in desktop programs like MS Excel. Currently we can find many solutions for this based on some CSS tricks and additional JS calculations but all of this is worst and have a lot of restrictions and errors in edge cases.

Basic concept:

  • position: sticky only for first column
  • position: sticky inside <td> styles makes this column stuck
  • position: sticky for <tr> makes row stuck

Of course there are a big number edge cases (e.g. which behavior should be with table-layout: fixed?) and all of it will be resolved if this idea will develop

@SelenIT
Copy link
Collaborator

SelenIT commented Jan 31, 2019

Technically, position: sticky is already supported for table cells (see example), so this approach already works in modern browsers. Some browsers still don't apply position: sticky to entire table rows and row groups, but this is just their known implementation bug that eventually will be fixed. Also, selecting the cells belonging to the same column may be rather tricky if the table has merged cells, but this should be addressed by the column combinator proposed in the CSS Selectors Level 4 spec.

@inoyakaigor
Copy link
Author

@SelenIT I forgot to add what i mean about sticky column: sticky column to easy horizontal scroll. I'll update the initial message.

@SelenIT
Copy link
Collaborator

SelenIT commented Jan 31, 2019

@inoyakaigor the example I linked to appears to demonstrate this behavior as well (try making the browser window narrower). Or am I missing something?

@inoyakaigor
Copy link
Author

@inoyakaigor yes that is what I said

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

No branches or pull requests

2 participants