crabbly / Print.js

A tiny javascript library to help printing from the web.
MIT License
4.28k stars 672 forks source link

How to print multi JSONdata #644

Open TingNLP opened 1 year ago

TingNLP commented 1 year ago

Dear author @crabbly In the example as follow:

 someJSONdata = [
    {
       name: 'John Doe',
       email: 'john@doe.com',
       phone: '111-111-1111'
    },
    {
       name: 'Barry Allen',
       email: 'barry@flash.com',
       phone: '222-222-2222'
    },
    {
       name: 'Cool Dude',
       email: 'cool@dude.com',
       phone: '333-333-3333'
    }
 ]

 <button type="button" onclick="printJS({printable: someJSONdata, properties: ['name', 'email', 'phone'], type: 'json'})">
    Print JSON Data
 </button>

And now I have another someJSONdata2, How to use someJSONdata and someJSONdata2 in printJS ? Is it possible like this printable: [someJSONdata, someJSONdata2] ? I just want to print two table.

thank you

536