question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Difficulty with table

See original GitHub issue

I have a table with fixed headers and a scrolling body. I implemented this by putting the following on tbody:

  .cf-document-list-body {
    display: block;
    max-height: 65vh;
    overflow: auto;
}

I would like to use ReactList to render the rows of this table.

In my itemsRenderer, I have:

    return <table>
        <HeaderRow columns={columns} headerClassName={headerClassName}/>
        <tbody className={bodyClassName} ref={ref}>
          {renderedItems}
        </tbody>
        <FooterRow columns={columns} />
    </table>;

I am passing scrollParentGetter to be a function that returns the tbody ref.

This produces the following HTML:

<div style="position: relative; height: 75511px;">
  <div style="transform: translate(0px, 0px);">
    <table>
      <!-- table contents are correct -->
    </table>
  </div>
</div>

This messes up my scrolling, and produces a giant div on the page that’s 75511px tall. I think that what needs to happen is the two wrapper divs need to be in the element that has fixed height. In my case, that’s the tbody, but it’s invalid HTML to put divs in a tbody.

I’m doing this for an open-source project, in case you want to see the full code: https://github.com/department-of-veterans-affairs/caseflow/pull/2019.

I’m not sure what the best way to fix this is. Why is it necessary to use these two wrapper divs? Why not just throw everything in the tbody, and then just add and remove elements according to their visibility, as determined by looking the tbody scroll and bounding rect attributes?

Or is there a different way you’d envisioned people doing this with tables?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
NickHeinercommented, May 17, 2017

Actually, would you be amenable to a PR to implement this functionality? Instead of the divs for spacing, it would use something like:

<tr style={{height: `${unrenderedPreviousElementsHeight}px`}} aria-hidden />
{* actual <tr>s for data *}
<tr style={{height: `${unrenderedPostElementsHeight}px`}} aria-hidden />
0reactions
NickHeinercommented, Jun 1, 2017

I’ve been working on this a bit, but it is not ready to show off yet.

I am not using position: fixed, so I can’t help you there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Table Difficulty Factor (TDF) - Billiard University (BU)
The Table Difficulty Factor (TDF) is a percentage measure of how difficult or easy a particular table plays. It is based on table...
Read more >
Table Difficulty Factor (TDF)
The Table Difficulty Factor (TDF) system provides a very easy system to measure how “tough” a table plays. It is based on table...
Read more >
What exactly is a difficulty table? : r/lunaticrave2 - Reddit
Basically, tables are a community voted rating system for charts' difficulties. Kinda like how there's tier lists for sdvx, ddr, etc if you...
Read more >
Difficulty Table X.1 | - Print Reach
The Paper Difficulty Table has two purposes: Purpose 1: Many digital printers cannot run all types of papers at the same speed. The...
Read more >
Untitled
Difficulty comparison table for the standard scales: · What are Difficulty Tables? Why use difficulty tables? What are Dan Courses? Using difficulty tables...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found