最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to freeze a pane in an Excel table using SheetJS? - Stack Overflow

programmeradmin2浏览0评论

I use SheetJS to make an Excel table in my node.js application:

const xlsx = require('xlsx');

const workbook = xlsx.utils.book_new();
const worksheet = xlsx.utils.aoa_to_sheet([
    ['Number', 'Name', 'Value'],
    [1, 'Bill', 1500],
    [2, 'John', 2300]
]);
xlsx.utils.book_append_sheet(workbook, worksheet, 'Accounts');
xlsx.writeFile(workbook, 'output.xlsx');

How to freeze a pane of the table, e.g. the first row? Saying "freeze" I mean making a row and/or a column always stay on the top of a table viewer interface.

I use SheetJS to make an Excel table in my node.js application:

const xlsx = require('xlsx');

const workbook = xlsx.utils.book_new();
const worksheet = xlsx.utils.aoa_to_sheet([
    ['Number', 'Name', 'Value'],
    [1, 'Bill', 1500],
    [2, 'John', 2300]
]);
xlsx.utils.book_append_sheet(workbook, worksheet, 'Accounts');
xlsx.writeFile(workbook, 'output.xlsx');

How to freeze a pane of the table, e.g. the first row? Saying "freeze" I mean making a row and/or a column always stay on the top of a table viewer interface.

Share Improve this question asked Feb 7, 2018 at 4:42 FinesseFinesse 10.8k7 gold badges71 silver badges93 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3

I just researched this, they don't offer freezing option in munity edition but in their pro pendium, one of the developers mentioned this in a GitHub issue.

The reference link is here. https://github./SheetJS/sheetjs/issues/785#issuement-390501860

It seems there were some tries to implement this feature, but as of version 0.14.1 it is still not available.

Someone in Apr 2, 2017 tried to implement it. I even tried using the sample code on the javascript ments but it didn't work.

Reference: Commit history on GitHub

Doing a code search on v.0.14.1 I found 3 instances of the word "Freeze":

0x0087: 'FREEZE.PANES', // On line 11478
case 'FreezePanes': break; // On line 15746
/* FreezePanes */ // On line 16113

So, it looks like there were some tries to implement it but there were removed/abandoned, at least on the munity version as of 0.14.

发布评论

评论列表(0)

  1. 暂无评论