Comments (6)
I probably should have commented earlier, but I've been very head-down. I have a PR for for #26 that will allow this, and much more. @romanstan1's solution as written is that it always assumes the first row is a header row, and that may not be the case.
I haven't officially submitted my code for #26 yet because I still need to bulk up the tests and documentation for it. I'll try to get on that.
from react-datasheet.
This how I make fixed headers when scrolling with awesome react-datasheet:
1 use css position sticky on
th { position: sticky; top: 0; }
-
then to make the header border not disappeared when it sticked on top
.data-grid-container .data-grid { border-collapse: separate; border-spacing: 0; }
-
don't forget to wrap
<table>
inside<div>
then set theheight
andoverflow-y: auto
to make it scroll
With this way you can also make horizontal srolling, and let the first column sticky left
from react-datasheet.
This how I make fixed headers when scrolling with awesome react-datasheet:
1 use css position sticky on
th { position: sticky; top: 0; }
- then to make the header border not disappeared when it sticked on top
.data-grid-container .data-grid { border-collapse: separate; border-spacing: 0; }
- don't forget to wrap
<table>
inside<div>
then set theheight
andoverflow-y: auto
to make it scrollWith this way you can also make horizontal srolling, and let the first column sticky left
Hi @aizaiz , please could you explain how to fixed header with more details. I don't understand where to set the height and overflow. Thanks
from react-datasheet.
Here's my solution - https://github.com/romanstan1/react-datasheet-header
from react-datasheet.
do you mind doing a pull request @romanstan1 ? thanks
from react-datasheet.
This how I make fixed headers when scrolling with awesome react-datasheet:
1 use css position sticky on
th { position: sticky; top: 0; }
- then to make the header border not disappeared when it sticked on top
.data-grid-container .data-grid { border-collapse: separate; border-spacing: 0; }
- don't forget to wrap
<table>
inside<div>
then set theheight
andoverflow-y: auto
to make it scrollWith this way you can also make horizontal srolling, and let the first column sticky left
Hi @aizaiz , please could you explain how to fixed header with more details. I don't understand where to set the height and overflow. Thanks
I set the height: auto; overflow-y: auto;
in .data-grid-container .data-grid
and it's work also.
from react-datasheet.
Related Issues (20)
- Callback while typing
- onCellsChange doesn't re-render changed cells HOT 1
- isCellNavigable is ignored when holding shift
- [Question]can react-datasheet work with Redux? HOT 1
- [Question] validate user's input when using react-datasheet as data input form HOT 1
- When I copy and paste from MS excel I am not getting exact value HOT 3
- Excel like Freeze Column HOT 1
- [Question] How to handle onDoubleClick for each cell? HOT 1
- Are types for default renderers, cell etc. missing?
- How to (programmatically) select all cells, then copy?
- feature request: influence enter key handling
- Allow Tab key in order to go out from the DataSheet to focus other DOM elements
- Bug: Copy and paste from MS Excel on a Windows machine pastes an extra empty cell HOT 1
- How do I initialize a datasheet with empty columns and rows which fills up my container? HOT 1
- What to use instead of deprecated `onPaste` function HOT 1
- Feature Request: Export as Excel/CSV HOT 2
- Does CTRL+Z word for undoing a paste? HOT 1
- Where can I see the code examples that are on the website? HOT 2
- Paste more rows than that is defined by the `grid`. HOT 2
- Deleting rows with Action Button HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-datasheet.