x-data-spreadsheet-bg
v1.1.2
Published
xpreadsheet change backgroundColor
Downloads
2
Maintainers
Readme
x-spreadsheet-bg
x-spreadsheet add custom background styles
Document
- en
- zh-cn 中文
NPM
npm install x-data-spreadsheet-bg
<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);
const s = new Spreadsheet("#x-spreadsheet-demo")
.loadData({}) // load data
.change(data => {
// save data to db
});
// data validation
s.validate()
// default options
{
mode: 'edit', // edit | read
showToolbar: true,
showGrid: true,
showContextmenu: true,
view: {
height: () => document.documentElement.clientHeight,
width: () => document.documentElement.clientWidth,
},
row: {
len: 100,
height: 25,
},
col: {
len: 26,
width: 100,
indexWidth: 60,
minWidth: 60,
},
style: {
bgcolor: '#ffffff',
align: 'left',
valign: 'middle',
textwrap: false,
strike: false,
underline: false,
color: '#0a0a0a',
font: {
name: 'Helvetica',
size: 10,
bold: false,
italic: false,
},
// Modify the header and index styles
customized:{
leftTopBG:'#e6e6e6',
headerBG:'#F4D5F8',
headerColor: '#585757',
headerLineColor: '#e6e6e6',
gridLineColor:'#e6e6e6'
}
},
}
import | export xlsx
https://github.com/SheetJS/sheetjs/tree/master/demos/xspreadsheet#saving-data
thanks https://github.com/SheetJS/sheetjs