Can I use the virtual scroll with a HTML table?
See original GitHub issueIs there any way to use this component with a table?
Something similar to:
<virtual-scroll [items]="rows" [childHeight]="30">
<tr *ngFor="let item of rows">
<td>Some text</td>
</tr>
</virtual-scroll>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:19
Top Results From Across the Web
cdk Virtual Scrolling with HTML table - angular - Stack Overflow
I have a good old HTML table with large number of rows. I want to display it on the screen with virtual scrolling...
Read more >virtual Scroll table - JSFiddle - Code Playground
* Creates a virtually-rendered scrollable list. * acceleration. We delete them once scrolling has finished.
Read more >Build your Own Virtual Scroll - Part I - DEV Community
In Regular scrolling, we have a scrollable container (or a viewport), and content, let's say - a list of items. The scrollable container...
Read more >Angular Table Virtual Scroll Sticky Headers (forked) - StackBlitz
Virtual Scroll with mat-table.
Read more >Angular7 - Materials/CDK-Virtual Scrolling - Tutorialspoint
We need to add the tag, <cdk-virtual-scroll-viewport></cdk-virtual-scroll-viewport> to work with virtual scroll module. The tag needs to be added to .html file ...
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
Hello @MastaBleh, I’m trying to use your suggestions, but i’m not getting good results.
This is my html
Css
I have followed your tips but what i’m getting is this
Get over the form of this message, but this discussion is loosing time & efforts of way too much people. Does anybody here as ever spent 5min to gather some informations ? God, its working, this discussion is bullshit. Only to say LOVE YOU all, i’ll spend 7min registering and writting this. Whats fed me up ? I got of course the same problem of you all but i simply did not stop at the first “its not working” comment…
What we want? simply the benefits of html table characteristics unstead of spending time to refactor all design into self managed div blocks. (also: the scrollbar in the tbody block, keep thoses th headers visible). The problem: html table are strict in the dom construction. note: elements involved with overflow property, in complex design could interfere, care.
Directive: @MrToasty97 Angular2-virtual-scroll directive is working out of the box. c’ant bind to ‘items’; directive is called ‘virtualScroll’ and not ‘virtual-scroll’. see demo/usage 3rd snippet :
Using directive in tbody context: not working
Implemented a2 virtual scroll in various context without problem (as directive or component), never managed to get the scroll working as expected in the described configuration. always as 1 of the following problem:
Here is the 10M$ working snippet
Key points:
Its working. (if not, i’ll be fed from your tears and might dig 2min to get it working for you (i also accept cash unstead of tears (i really prefer your tears))).
And for very large list (when you want to mind fuck your users or when you cant ask 10K+ object to your api), use this component for with “proxy” binding. (in comp.ts) this.placeHolders: number[] = Array.from(Array(10000).keys()); -> generate [0,1,…,10000] and in set visibleElements(value: any[]) { console.log(value); //ex: print: [18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36] // get elements 18 to 36 from your api this.visibleElements$ = value; }
Thank you Rinto Jose, it’s appreciated that you spent some time giving us this virtual scroll. LOVE you people with the art of saying bullshits without the capacities to evaluate the consequences of misinformation.