I am using officeGen to generate word documents.
<sup> let table = [
[
{
val: "TT",
fontFamily: "Times New Roman",
},
{
val: "Ten hang",
fontFamily: "Times New Roman",
},
{
val: "DVT",
fontFamily: "Times New Roman",
},
{
val: "S.luong",
fontFamily: "Times New Roman",
},
{
val: "Don gia",
fontFamily: "Times New Roman",
},
{
val: "Thanh tien",
fontFamily: "Times New Roman",
}],
[1, "Cáp ngầm LS 24kv CXV/DSTA/PVC 1x95mm2", "Met", 119, "420,000", "49,980,000"],
[2, "Cáp ngầm LS 24kv CXV/DSTA/PVC 1x95mm2", "Met", 253, "420,000", "49,980,000"],
];
var tableStyle = {
// tableColWidth: 4200,
// tableSize: 1000,
tableColor: "ada",
tableAlign: "left",
tableFontFamily: "Times New Roman",
spacingBefor: 120, // default is 100
spacingAfter: 120, // default is 100
spacingLine: 240, // default is 240
spacingLineRule: "atLeast", // default is atLeast
// indent: 100, // table indent, default is 0
// fixedLayout: true, // default is false
borders: true, // default is false. if true, default border size is 4
borderSize: 2, // To use this option, the 'borders' must set as true, default is 4
columns: [{ width: 100 }, { width: 200 }, { width: 200 }, { width: 100 }, { width: 200 }, { width: 200 }], // Table logical columns
};
docx.createTable(table, tableStyle);
</sup>
Here is the result:
enter image description here ],
I want the 1st col is 100, the 2nd col is 200, But it not work as i hoped
Any help?? Thanks!
//Generating word document with OfficeGen documentation
2
Answers
This is all my source code
In your tableStyle object, you’re setting both
tableColWidth
andcolumns
, but these properties conflict with each other.edit: