0

What I want to do is to find all tables in my page:

$('table')

In jQuery, and then to convert all of them to one excel file and one sheet. The tables should appear in the same order like they appear in the original page, with an empty excel row between them.

I have found already many answers about converting a single table to excel or two with same rows/columns size, but I didn't find any clue for what I'm trying to do.

This is what I used so far: http://jsfiddle.net/cmewv/537

1 Answers1

0

Here's my solution, appending all the tables to one table. Ugly - but works.

$('body').append('<table style="display:none;" id="test"></table>');

$('table').each(function() {
    $('#test').append($(this).html()); 
    $('#test').append('<tr><td/></tr>');
  });

$('table#test').remove();

And then just to use any table to excel converter code approach (before doing last command).