natergj / excel4node

Node module to allow for easy Excel file creation
MIT License
1.38k stars 215 forks source link

Border not work on office 2016 #247

Closed yogisaka closed 6 years ago

yogisaka commented 6 years ago

Im try add border on my excel but not work on office 2016. im try on libre office border work. merge cell and add border image

string content with style wrap text image

pkolawa commented 6 years ago

so you've merged cells first and then add the border?

yogisaka commented 6 years ago

yes im do like this:

ws.cell(15, 1, 15, 4, true).string('This test data for this content on the table').style({font: {size: 12,name: 'Arial',bold: true,},alignment: {wrapText: true,horizontal: 'center',vertical: 'center'},border: {top: {style: 'thin'},bottom: {style: 'thin'},left: {style: 'thin'},right: {style: 'thin'}}});

if im insert many string data, this border gone, and try print preview on MS excel all border gone. and im try install office 2010 and try open excel and this same result like office 2016.

pkolawa commented 6 years ago

Unfortunatelly, on Excel 365 on Mac the code you have sent works perfectly well. zrzut ekranu 2018-10-10 o 21 45 10

yogisaka commented 6 years ago

im found this problem. if im write style let MyStyle = wb.createStyle({ font: { size: 12, name: 'Arial', bold: true, }, alignment: { wrapText: true, horizontal: 'center', vertical: 'center' }, border: { right:{ style: 'thin' }, left:{ state: 'thin' }, bottom: { style: 'thin' }, top:{ style: 'thin' } } });

and use on cell

ws.cell(15, 1, 15, 4, true).string('This test data for this content on the table').style(MyStyle);

border is not working. but im use directly like this ws.cell(15, 1, 15, 4, true).string('This test data for this content on the table').style({font: {size: 12,name: 'Arial',bold: true,},alignment: {wrapText: true,horizontal: 'center',vertical: 'center'},border: {top: {style: 'thin'},bottom: {style: 'thin'},left: {style: 'thin'},right: {style: 'thin'}}});

its work. i dont know what happend on my code. but thx for respose

pkolawa commented 6 years ago

So we can close the issue?

yogisaka commented 6 years ago

Yes thanks