tableExport.jquery.plugin icon indicating copy to clipboard operation
tableExport.jquery.plugin copied to clipboard

How about to add print option, and also set header text and footer text options?

Open arivera12 opened this issue 8 years ago • 6 comments

Something like $('#tableID').tableExport({type:'print'}); would be nice to add. I think you should consider printing also an export option.

Consider this plugin to achieve this easily: jQuery.print;

Also when we are working with some type of document lets say like DOC, PNG or PDF. If the table don't have any title on it, or the document name doesnt match the exported data, the table could become a little meaningless I think. I think it would be nice to add an option to add html on the header and footer of the table with something like this only just for DOC, PNG or PDF and Print (if u add it).

image

$('#tableID').tableExport({
type:'print', 
header: '<div class="text-center">Title Here<div>',
footer, '<small>Special Footer Here</small>'
});

arivera12 avatar Feb 11 '17 23:02 arivera12

Thanks for your suggestion, its quite interesting. But I'm not sure if a export plugin should realy print its output. Aren't export and print concurrent functionallities? Especially considering that both plugins (tableexport and print) can be included and called without a big effort. Regarding jQuery.print: this plugin prints any dom element conatined in a browser window or frame. As I understand it, you can't feet it with text or string content that you want to print, Everything must exist inside dom. On the other hand the tableexport plugin itself parses the dom (html table element) and produces format dependent output. Considering how both plugins work, I can't see how you can bring them together.

I'll take your other suggestion, to add an optional header/footer to a html table before it will be exported, into consideration and put your suggestion on to my (growing) list of feature requests. Thanks.

hhurz avatar Feb 12 '17 13:02 hhurz

I have made a bootstrap base toolbar that works very well with your plugin take a look of it. image Your plugin its a must fo any system's core. Helps to take off a lot of effort for exporting options. You can find table export on any system or software where data management is everywhere. The header and footer options I think could fit only DOC, PNG or PDF. The other exports options I don't really think we need this options.

arivera12 avatar Feb 12 '17 22:02 arivera12

I like the option of optional header and footer text but I think it should also apply to Excel. Some old, defunct code I used in the past had this feature and I miss it because, as @arivera12 describes, it helps provide context to the output file.

schutze avatar Sep 27 '17 14:09 schutze

If anyone is interest on this option using jQuery.print goes like this: jQuery("table").print({ stylesheet: "css/my-stylesheet" });

arivera12 avatar Nov 18 '17 01:11 arivera12

Hello,

I am with a problem! When I use the checks to export the datatable, the last row not is print. The footer is work perfect, but last row is not work. How I can resolv this problem?

This problem occur always that not check all options in datatable.

table

maikosantos avatar Mar 22 '18 17:03 maikosantos

Has a Title feature been added since this post was created?

davidbarman avatar Jul 23 '23 00:07 davidbarman