Can you use Javascript to do the following pseudocode? (in a browser) explanation of below code: similar to word processor behavior, it will take a long table that overflows a page break and split the cells so that there is no graphical breakage, and repeat the header row on the next page if the table has a header row (or multiple header rows).
Example of problem:

if printing page to pdf
{
 if table is overflowing a page break
 {
  if table has header row
   {
   split table so that rows print without breaking and repeat header row on next page
   }
  else if table does not have header row
   {
   split table so that rows print without breaking
   }
 }
}
 
     
    