Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

soldemuth
Copy link

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

@linYeeTracy
Copy link

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
Copy link
Author

soldemuth commented Mar 29, 2018

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
Copy link

@soldemuth not working, you can show full example ?

@tinamore
Copy link

@soldemuth working. I have set

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

Thanks for fix.

@soldemuth
Copy link
Author

@tinamore that's great!

@phostann
Copy link

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

@nextdooroldwang
Copy link

@tinamore not working, you can show full example ?

@nextdooroldwang
Copy link

@phostann Have you solved this problem?

@sonicwong
Copy link

sonicwong commented Sep 5, 2019

@qq820137708
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants