Using html table element
See original GitHub issueDo you have an example of using this with tables? I’m trying to get it working but I have a strong suspicion that it either doesn’t work, or that I’m doing something very wrong. I’ve set the outerTagName to “table” and the innerTagName to “tbody”, but I don’t get any scrolling.
Here is my code, not sure if it helps (items is a list of objects):
<List
outerRef={this._list}
outerTagName="table"
innerTagName="tbody"
height={300}
itemData={items}
itemSize={() => 30}
itemCount={items.length}
itemKey={item => item.uniqueId}>
{({index, style, data}) => {
return (
<tr style={style} key={index}>
<td>Item {index}</td>
</tr>
);
}}
</List>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:38 (7 by maintainers)
Top Results From Across the Web
<table>: The Table element - HTML - MDN Web Docs - Mozilla
The <table> HTML element represents tabular data — that is, information presented in a two-dimensional table comprised of rows and columns ...
Read more >HTML Tables - W3Schools
A table in HTML consists of table cells inside rows and columns. ... Note: A table cell can contain all sorts of HTML...
Read more >How to use the 'table' element in HTML - Educative.io
An HTML table element consists of some tags and attributes necessary to build a table. Those tags are as follows: ... The <table>,...
Read more >HTML Table - Javatpoint
HTML table tag is used to display data in tabular form (row * column). There can be many columns in a row. We...
Read more >HTML - Tables - Tutorialspoint
Table heading can be defined using <th> tag. This tag will be put to replace <td> tag, which is used to represent actual...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pupudu I applaud your open source efforts and looked through your code extensively before deciding to try to tackle this on my own. I just wanted the super straightforward thing other people were looking for: this library but with table elements.
Turns out I was able to pull this off with a very small bit of code, and a lot of creativity. The code is simple enough that anyone should be able to copy / paste and extend to their liking. @bvaughn after figuring out the how, this would be pretty trivial to add to the library if you want, but also pretty trivial to override if you know how.
The short of it:
Working Code Sandbox: https://codesandbox.io/s/react-window-with-table-elements-d861o
Code for reference
IE11 is not something you should be supporting anymore 😃