-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 title to worksheet #240
Comments
Hey @NandoMB, if I understand your issue correctly do the following to give your worksheets a title: I would store the worksheet title in a variable and later assign that as your const wsTitle = 'Nando Title'; // Store our title in a variable
const ws = workbook.addWorksheet(wsTitle); // Create our worksheet with the desired title
...
ws.getCell(`A1`).value = wsTitle; // Assign title to cell A1 -- THIS IS WHAT YOU'RE LOOKING FOR.
ws.mergeCells('A1:G1'); // Extend cell over all column headers
ws.getCell(`A1`).alignment = { horizontal: 'center' }; // Horizontally center your text
... Let me know if that helps at all. |
Note for anyone reading this. Microsoft Excel has a max length on worksheet titles of 30 chars, and, the following chars are invalid:
|
This doesn't work. The problem is needing to shift/ set a start row line to start the columns at or something. |
#433 Solves this for me. The trick is to not set a As long as you set the columns with the correct
|
Hi man, first of all, I'd like to congratulate you for your awesome project!
I'd like to know if is possible to insert an "title" for my worksheet, above of columns headers?
Something like the green cell on image bellow:
Thank you for your attention 😃
The text was updated successfully, but these errors were encountered: