markmalek / Fixed-Header-Table

jQuery plugin for tables with fixed headers
www.fixedheadertable.com
MIT License
931 stars 542 forks source link

performances #19

Open ldup opened 12 years ago

ldup commented 12 years ago

Hi,

This plugin works great. Thanks. We have some performances issue on large and complex tables, though. (Large tables are good candidates for fixed header, as you can imagine...)

Thanks for looking into it, or give us a clue so we can improve performances ourselves.

I don't how to post the HTML source (which is1.3 Mb. ) The HTML table has 106 base rows, but many rowspans and inner tables. There's something like 40 000 HTML lines. It takes around 1 minutes to be processed.

Laurent

markmalek commented 12 years ago

I have not tested the plugin against nested tables. I believe the issue is its traversing through all your tables including the nested tables in your rows. You might want to look into amending the plugin to only look at direct descendants ('>' selector) instead of all children. This may improve your performance issues.

The plugin has to traverse the dom through the first header row and first tbody row to set fixed widths. My guess is its including more than just the first row because of the nested tables.