protobi / js-xlsx

XLSX / XLSM / XLSB (Excel 2007+ Spreadsheet) / ODS parser and writer
http://oss.sheetjs.com/js-xlsx
Other
814 stars 416 forks source link

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

Open soldemuth opened 6 years ago

soldemuth commented 6 years ago

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

linYeeTracy commented 6 years ago

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

soldemuth commented 6 years ago

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();
tinamore commented 6 years ago

@soldemuth not working, you can show full example ?

tinamore commented 6 years ago

@soldemuth working. I have set

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

Thanks for fix.

soldemuth commented 6 years ago

@tinamore that's great!

phostann commented 5 years ago

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

nextdooroldwang commented 5 years ago

@tinamore not working, you can show full example ?

nextdooroldwang commented 5 years ago

@phostann Have you solved this problem?

sonicwong commented 4 years ago

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

qq820137708 commented 3 years ago

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