Word(*.docx) generate table : Write bullet points (list of dots) inside the table

182 views
Skip to first unread message

dhruve...@volansystech.com

unread,
Oct 9, 2017, 2:47:03 AM10/9/17
to node.js officegen package

Hi,
Thank you for officegen, simple and amazing package !
While implementing I am stuck on something ,Can you please help me to resolve few queries?

Q1- How can I write bullet points inside the table? Or how can I use createListOfDots in table?
For Example:
Column1

  • Val1
  • Val2
  • Val3

Q2 - How can I insert new line between two content without creating new paragraph ?
Q3- I tried to justify the table content, but it is not working. Please have a look my code.

   var table = [
            [{
                val: Value1,
                opts: {
                    b: true,
                    cellColWidth: 1000, // not working
                    fontFamily: 'Calibri',
                    align: 'justify', // justify not working
                    sz: '22',
                }
            }, {
                val: Value2,
                opts: {
                    cellColWidth: 3000, // not working
                    fontFamily: 'Calibri',
                    align: 'justify', // justify not working
                    sz: '22',
                    //list_type : '1'
                },
            }]
        ]

        var tableStyle = {
            tableColWidth: 4000, // Only this working
            tableAlign: 'justify ',
            tableFontFamily: 'Calibri',
            borders: true,
            borderSize: 6, // size of border width
        };
        var pObj2 = docx.createTable(table, tableStyle);

Q4 - For the above code, How can I give specific width to column ?
I need to give 30% width to column1 and 70% to column2. Using this code, it divides the 2 column into 50-50%.
Q5- How can I give table border size ? For the above code, border size is not working. For example If I give borderSize: 6 to 24 then size remains same.

I would really appreciate your help !

dhruve...@volansystech.com

unread,
Oct 9, 2017, 11:14:12 AM10/9/17
to node.js officegen package
Q2 - How can I insert new line between two content without creating new paragraph ?
For this I tried, "\n\r","\n","\v",,"\v",,"\v+","char(10)". But looks like, not working for google doc. Any suggestions?
Reply all
Reply to author
Forward
0 new messages