Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
X

x-spreadsheet

> 编程语言
Open source

The project has been migrated to @wolf-table/table https://github.com/wolf-table/table

14.6K stars0 likes1 views
WebsiteGitHub

About

The project has been migrated to @wolf-table/table https://github.com/wolf-table/table

x-spreadsheet

A web-based JavaScript spreadsheet

Document

  • en
  • zh-cn 中文

CDN

xml
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/xspreadsheet.css">
<script src="https://unpkg.com/[email protected]/dist/xspreadsheet.js"></script>

<script>
   x_spreadsheet('#xspreadsheet');
</script>

NPM

bash
npm install x-data-spreadsheet
xml
javascript
import Spreadsheet from "x-data-spreadsheet";
// If you need to override the default options, you can set the override
// const options = {};
// new Spreadsheet('#x-spreadsheet-demo', options);
const s = new Spreadsheet("#x-spreadsheet-demo")
  .loadData({}) // load data
  .change(data => {
    // save data to db
  });

// data validation
s.validate()
…

import | export xlsx

https://github.com/SheetJS/sheetjs/tree/master/demos/xspreadsheet#saving-data

thanks https://github.com/SheetJS/sheetjs

Bind events

javascript
const s = new Spreadsheet("#x-spreadsheet-demo")
// event of click on cell
s.on('cell-selected', (cell, ri, ci) => {});
s.on('cells-selected', (cell, { sri, sci, eri, eci }) => {});
// edited on cell
s.on('cell-edited', (text, ri, ci) => {});

update cell-text

javascript
const s = new Spreadsheet("#x-spreadsheet-demo")
// cellText(ri, ci, text, sheetIndex = 0)
s.cellText(5, 5, 'xxxx').cellText(6, 5, 'yyy').reRender();

get cell and cell-style

javascript
const s = new Spreadsheet("#x-spreadsheet-demo")
// cell(ri, ci, sheetIndex = 0)
s.cell(ri, ci);
// cellStyle(ri, ci, sheetIndex = 0)
s.cellStyle(ri, ci);

Internationalization

javascript
// npm 
import Spreadsheet from 'x-data-spreadsheet';
import zhCN from 'x-data-spreadsheet/dist/locale/zh-cn';

Spreadsheet.locale('zh-cn', zhCN);
new Spreadsheet(document.getElementById('xss-demo'));
xml

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/xspreadsheet.css">
<script src="https://unpkg.com/[email protected]/dist/xspreadsheet.js"></script>
<script src="https://unpkg.com/[email protected]/dist/locale/zh-cn.js"></script>

<script>
  x_spreadsheet.locale('zh-cn');
</script>

Features

  • Undo & Redo
  • Paint format
  • Clear format
  • Format
  • Font
  • Font size
  • Font bold
  • Font italic
  • Underline
  • Strike
  • Text color
  • Fill color
  • Borders
  • Merge cells
  • Align
  • Text wrapping
  • Freeze cell
  • Functions
  • Resize row-height, col-width
  • Copy, Cut, Paste
  • Autofill
  • Insert row, column
  • Delete row, column
  • hide row, column
  • multiple sheets
  • print
  • Data validations

Development

sheel
git clone https://github.com/myliang/x-spreadsheet.git
cd x-spreadsheet
npm install
npm run dev

Open your browser and visit http://127.0.0.1:8080.

Browser Support

Modern browsers(chrome, firefox, Safari).

LICENSE

MIT

Issues· 412 open

View all issuesOpen on GitHub
  • #701

    非初始化的導入多 sheet 後,切換 sheet 會出現 this.data is undefined 的問題

    Updated Aug 10, 2026
  • #744

    回退功能没有正确的回退,而是把单元格清空了

    Updated Jun 29, 2026
  • #720

    切换页面导致内存泄漏

    Updated Dec 3, 2025
  • #742

    如何禁用sheet栏

    Updated Dec 3, 2025
  • #704

    使用loaddata接口,渲染出来的合并的表格样式有错误

    Updated Nov 11, 2025
  • #730

    可以实现增量提交数据到服务端吗

    Updated Aug 13, 2025
  • #739

    Copy和Paste时的异常

    Updated Jul 23, 2025
  • #737

    公式的引用计算结果不正确

    Updated Jul 15, 2025
  • #449

    Add custom icon in toolbar

    Updated Jul 10, 2025
  • #652

    下拉框选择选项后,没有触发cell–edited事件

    Updated Jun 24, 2025

> Tags

JavaScriptcanvases6exceljavascript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言