I have a problem where a table has 100s of rows. It causes an issue and needs to be split into several smaller tables with fewer rows each.
My html is valid xml as
Here's an XSLT2 solution using for-each-group. To change the number of items per table change the divisor in the group-adjacent attribute. Tested in Oxygen/XML with Saxon 9.2.
Explanation:
Note that if you had nested tables inside the rows you'd have to modify this slightly to avoid having the "table" template match the inner tables.