Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

How can I freeze first row? #151

Closed
phaibin opened this issue Jul 22, 2016 · 10 comments
Closed

How can I freeze first row? #151

phaibin opened this issue Jul 22, 2016 · 10 comments

Comments

@phaibin
Copy link

phaibin commented Jul 22, 2016

No description provided.

@guyonroche
Copy link
Collaborator

Like this:
worksheet.views = [
{state: 'frozen', ySplit: 1}
];

@zjleon
Copy link

zjleon commented Aug 31, 2017

I tried the newest code, and found the 'views' is moved to options, but the document is not updated accordingly, so anyone use the newest version should try below code:

workbook.addWorksheet(sheetName, {
views: [
{state: 'frozen', ySplit: 1}
]
});

@marko033
Copy link

What if i want freeze not first but only second row.
When i use ySplit: 2 will be frozen first and second row but i want only second not first.
Is this possible?

@nakshay
Copy link

nakshay commented Jun 11, 2019

What if i want freeze not first but only second row.
When i use ySplit: 2 will be frozen first and second row but i want only second not first.
Is this possible?

I have same question, how to freeze selected cells

@johnGeorge4
Copy link

What if i want freeze not first but only second row.
When i use ySplit: 2 will be frozen first and second row but i want only second not first.
Is this possible?

I have same question, how to freeze selected cells

Has anyone been able to find a solution? I'm trying this as well, and even when setting up a template that I am filling out through my code I can't find a solution or viable work-around.

@nakshay
Copy link

nakshay commented Sep 27, 2019

What if i want freeze not first but only second row.
When i use ySplit: 2 will be frozen first and second row but i want only second not first.
Is this possible?

I have same question, how to freeze selected cells

Has anyone been able to find a solution? I'm trying this as well, and even when setting up a template that I am filling out through my code I can't find a solution or viable work-around.

didn't find anything useful yet

@gergoh
Copy link

gergoh commented Jan 6, 2020

Any update on freezing other rows than the first? I've been searching for a while now.

@johnGeorge4
Copy link

@gergoh I never found a solution. Luckily for me, I was able to convince my team that we needed to find another design to go with.

@gergoh
Copy link

gergoh commented Jan 6, 2020

@johnGeorge4 Seems like, I need to do the same thing. ExcelJS seems more and more limited as I work with it. It's really unfortunate.

@johnGeorge4
Copy link

@gergoh honestly from the research I did while working on this at the time, it's more of a limitation of Excel itself. If I recall correctly, Excel is capable of freezing the first row (or multiple rows, given that there are no unfrozen rows between the first row and the end of the frozen rows) or freezing columns (though I did not look much into this part of the feature since I had no use for it). If there is ever an update to Excel to allow for more dynamic freezing of rows, then I wouldn't be surprised to see an update to ExcelJS to account for it. It seems right now the biggest roadblock is the default software that the package is using, if that makes sense.

@exceljs exceljs locked and limited conversation to collaborators Sep 21, 2023
@Siemienik Siemienik converted this issue into discussion #2514 Sep 21, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants