Giter VIP home page Giter VIP logo

Comments (6)

patrick-jones avatar patrick-jones commented on May 10, 2024 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.

aizaiz avatar aizaiz commented on May 10, 2024 3

This how I make fixed headers when scrolling with awesome react-datasheet:

1 use css position sticky on
th { position: sticky; top: 0; }

  1. then to make the header border not disappeared when it sticked on top
    .data-grid-container .data-grid { border-collapse: separate; border-spacing: 0; }

  2. don't forget to wrap <table> inside <div> then set the height and overflow-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.

MarcoSapienza avatar MarcoSapienza commented on May 10, 2024 1

This how I make fixed headers when scrolling with awesome react-datasheet:

1 use css position sticky on
th { position: sticky; top: 0; }

  1. then to make the header border not disappeared when it sticked on top
    .data-grid-container .data-grid { border-collapse: separate; border-spacing: 0; }
  2. don't forget to wrap <table> inside <div> then set the height and overflow-y: auto to make it scroll

With 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.

romanstan1 avatar romanstan1 commented on May 10, 2024

Here's my solution - https://github.com/romanstan1/react-datasheet-header

from react-datasheet.

nadbm avatar nadbm commented on May 10, 2024

do you mind doing a pull request @romanstan1 ? thanks

from react-datasheet.

mohridwanhdp avatar mohridwanhdp commented on May 10, 2024

This how I make fixed headers when scrolling with awesome react-datasheet:
1 use css position sticky on
th { position: sticky; top: 0; }

  1. then to make the header border not disappeared when it sticked on top
    .data-grid-container .data-grid { border-collapse: separate; border-spacing: 0; }
  2. don't forget to wrap <table> inside <div> then set the height and overflow-y: auto to make it scroll

With 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.