Permalink
Branch: master
Find file Copy path
a187f9d Feb 13, 2019
3 contributors

Users who have contributed to this file

@myliang @mohapakram @div5yesh
96 lines (79 sloc) 2.01 KB

x-spreadsheet

npm package NPM downloads Join the chat at https://gitter.im/x-datav/spreadsheet

A web-based JavaScript spreadsheet

Install

npm install x-data-spreadsheet

Quick Start

<div id="x-spreadsheet-demo"></div>
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);
new Spreadsheet("#x-spreadsheet-demo")
  .loadData({}) // load data
  .change(data => {
    // save data to db
  });
// default options
{
  view: {
    height: () => document.documentElement.clientHeight - 41,
    width: () => document.documentElement.clientWidth,
  },
  formats: [],
  fonts: [],
  formula: [],
  row: {
    len: 100,
    height: 25,
  },
  col: {
    len: 26,
    width: 100,
    indexWidth: 60,
    minWidth: 60,
  },
  style: {
    bgcolor: '#ffffff',
    align: 'left',
    valign: 'middle',
    textwrap: false,
    textDecoration: 'normal',
    strikethrough: false,
    underline: false,
    color: '#0a0a0a',
    font: {
      name: 'Helvetica',
      size: 10,
      bold: false,
      italic: false,
    },
  },
}

Development

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