js-xlsx icon indicating copy to clipboard operation
js-xlsx copied to clipboard

Add row height (SheetJS/js-xlsx/issues/856)

Open soldemuth opened this issue 7 years ago • 10 comments

I needed row heights; changes pulled straight from SheetJS/js-xlsx master 0.11.10

soldemuth avatar Nov 23 '17 03:11 soldemuth

hey bro, i find that 'xlsx-style' dont work ws['!rows'], i really added it, but it really did not works , how can i solve it, thanls

linYeeTracy avatar Mar 29 '18 13:03 linYeeTracy

linYeeTracy, I did something like:

var dataRows     = [];
// populate dataRows Array with styled rows (borders, colors, etc.)...

var workbook = new Workbook().addRowsToSheet("Sheet1", dataRows);
// set workbook colwidths, merge cells etc...

var worksheet = workbook.getSheet("Sheet1");

worksheet['!rows'] = [];

// let's set row heights
for (i = 0; i < dataRows.length + 10; i++) {
        worksheet['!rows'].push({
            hpt: 16,
     });
}

workbook.finalize();

soldemuth avatar Mar 29 '18 15:03 soldemuth

@soldemuth not working, you can show full example ?

tinamore avatar Jun 27 '18 02:06 tinamore

@soldemuth working. I have set

ws["!rows"] = [....]

Thanks for fix.

tinamore avatar Jun 27 '18 02:06 tinamore

@tinamore that's great!

soldemuth avatar Jun 27 '18 02:06 soldemuth

@soldemuth I have modified xlsx.js according to your commit but ws['!rows'] still doesn't work. can you help me , master...

phostann avatar Aug 12 '18 11:08 phostann

@tinamore not working, you can show full example ?

nextdooroldwang avatar Mar 08 '19 03:03 nextdooroldwang

@phostann Have you solved this problem?

nextdooroldwang avatar Mar 08 '19 03:03 nextdooroldwang

@phostann @nextdooroldwang Use this js file. it is working: https://github.com/soldemuth/js-xlsx/blob/master/dist/xlsx.full.min.js

sonicwong avatar Sep 05 '19 07:09 sonicwong

sheet['!rows'] = [{...}]; Can you change the font weight of Excel

qq820137708 avatar Jan 22 '21 06:01 qq820137708