How to add tables into pptx in officegen2

243 views
Skip to first unread message

Jeevitha G

unread,
Nov 11, 2014, 12:33:51 AM11/11/14
to node-of...@googlegroups.com
Hi,

 I am trying to add tables into pptx . But there are no samples for that in officegen2. Can you help me with the same.


Regards
Jeevitha.G

John D. Lewis

unread,
Jul 14, 2016, 10:46:29 AM7/14/16
to node.js officegen package
The test for PPT generation (https://github.com/Ziv-Barber/officegen/blob/master/test/test-pptx-nocharts.js) includes this section to add a slide with a table:

Lines 231-239:

    var rows = [];
     
   for (var i = 0; i < 12; i++) {
     var row = [];
       
     for (var j = 0; j < 5; j++) {
       
       row.push("[" + i + "," + j + "]");
       
     }
     
      rows.push(row);
     
   }
   slide.addTable(rows, {});



Reply all
Reply to author
Forward
0 new messages