Spreadsheet Grid Line
The property gridline: false disables the worksheet grid line. Default: true
Examples
How to disable the grid line on the spreadsheet grid line.
|
---|
1 | Mazda | 2001 | 2000 | 1 |
2 | Peugeot | 2010 | 5000 | 1 |
3 | Honda Fit | 2009 | 3000 | 1 |
4 | Honda CRV | 2010 | 6000 | 0 |
<script src="https://jspreadsheet.com/v10/jspreadsheet.js"></script>
<script src="https://jsuites.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jspreadsheet.com/v10/jspreadsheet.css" type="text/css" />
<link rel="stylesheet" href="https://jsuites.net/v5/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
<div id="spreadsheet"></div>
<p><input type="button" value="toggle()" id="togglebtn"></p>
<script>
let toggle = function(worksheet) {
if (worksheet.table.classList.contains('jss_nogridline')) {
worksheet.table.classList.remove('jss_nogridline');
} else {
worksheet.table.classList.add('jss_nogridline');
}
}
jspreadsheet.setLicense('ZjJkOTdiYzJjNDI4ZWFmMTcyMWJiY2Y1YTk0NTM1NzA1YWZiYzM5MWIwY2U0ODE0NGM1MzcwZGE0MTdiNTBhMDE3NDg3NWIxZDE5NGIyNjFmY2YxNmJiYWY5YzViMjIxMjViOWU5YWUxYzAzZWMwZDM3MmNmYTQzMThiYmFjZDAsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpRek9EUTJPRGs1TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0ozWldJaUxDSnNiMk5oYkdodmMzUWlYU3dpY0d4aGJpSTZJak0wSWl3aWMyTnZjR1VpT2xzaWRqY2lMQ0oyT0NJc0luWTVJaXdpZGpFd0lpd2lkakV4SWl3aVkyaGhjblJ6SWl3aVptOXliWE1pTENKbWIzSnRkV3hoSWl3aWNHRnljMlZ5SWl3aWNtVnVaR1Z5SWl3aVkyOXRiV1Z1ZEhNaUxDSnBiWEJ2Y25SbGNpSXNJbUpoY2lJc0luWmhiR2xrWVhScGIyNXpJaXdpYzJWaGNtTm9JaXdpY0hKcGJuUWlMQ0p6YUdWbGRITWlMQ0pqYkdsbGJuUWlMQ0p6WlhKMlpYSWlMQ0p6YUdGd1pYTWlYU3dpWkdWdGJ5STZkSEoxWlgwPQ==');
let worksheets = jspreadsheet(document.getElementById('spreadsheet'), {
worksheets: [{
data: [
['Mazda', 2001, 2000, 1],
['Peugeot', 2010, 5000, 1],
['Honda Fit', 2009, 3000, 1],
['Honda CRV', 2010, 6000, 0],
],
gridline: false,
}]
});
document.getElementById("togglebtn").onclick = () => toggle(worksheets[0]);
</script>
</html>
import React, { useRef } from "react";
import { Spreadsheet, Worksheet } from "@jspreadsheet/react";
const license = 'ZjJkOTdiYzJjNDI4ZWFmMTcyMWJiY2Y1YTk0NTM1NzA1YWZiYzM5MWIwY2U0ODE0NGM1MzcwZGE0MTdiNTBhMDE3NDg3NWIxZDE5NGIyNjFmY2YxNmJiYWY5YzViMjIxMjViOWU5YWUxYzAzZWMwZDM3MmNmYTQzMThiYmFjZDAsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpRek9EUTJPRGs1TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0ozWldJaUxDSnNiMk5oYkdodmMzUWlYU3dpY0d4aGJpSTZJak0wSWl3aWMyTnZjR1VpT2xzaWRqY2lMQ0oyT0NJc0luWTVJaXdpZGpFd0lpd2lkakV4SWl3aVkyaGhjblJ6SWl3aVptOXliWE1pTENKbWIzSnRkV3hoSWl3aWNHRnljMlZ5SWl3aWNtVnVaR1Z5SWl3aVkyOXRiV1Z1ZEhNaUxDSnBiWEJ2Y25SbGNpSXNJbUpoY2lJc0luWmhiR2xrWVhScGIyNXpJaXdpYzJWaGNtTm9JaXdpY0hKcGJuUWlMQ0p6YUdWbGRITWlMQ0pqYkdsbGJuUWlMQ0p6WlhKMlpYSWlMQ0p6YUdGd1pYTWlYU3dpWkdWdGJ5STZkSEoxWlgwPQ==';
const toggle = function(worksheet) {
if (worksheet.table.classList.contains('jss_nogridline')) {
worksheet.table.classList.remove('jss_nogridline');
} else {
worksheet.table.classList.add('jss_nogridline');
}
}
export default function App() {
const spreadsheet = useRef();
const data = [
['Mazda', 2001, 2000, 1],
['Peugeot', 2010, 5000, 1],
['Honda Fit', 2009, 3000, 1],
['Honda CRV', 2010, 6000, 0],
]
return (
<>
<Spreadsheet ref={spreadsheet} license={license} toolbar gridline>
<Worksheet data={data} />
</Spreadsheet>
<input type="button" value="toggle()" onClick={() => toggle(spreadsheet.current[0])} />
</>
);
}
<template>
<Spreadsheet ref="spreadsheet" :license="license" toolbar>
<Worksheet :data="data" />
</Spreadsheet>
<input type="button" value="toggle()" @click="toggle" />
</template>
<script>
import { Spreadsheet, Worksheet } from "@jspreadsheet/vue";
const license = 'ZjJkOTdiYzJjNDI4ZWFmMTcyMWJiY2Y1YTk0NTM1NzA1YWZiYzM5MWIwY2U0ODE0NGM1MzcwZGE0MTdiNTBhMDE3NDg3NWIxZDE5NGIyNjFmY2YxNmJiYWY5YzViMjIxMjViOWU5YWUxYzAzZWMwZDM3MmNmYTQzMThiYmFjZDAsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpRek9EUTJPRGs1TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0ozWldJaUxDSnNiMk5oYkdodmMzUWlYU3dpY0d4aGJpSTZJak0wSWl3aWMyTnZjR1VpT2xzaWRqY2lMQ0oyT0NJc0luWTVJaXdpZGpFd0lpd2lkakV4SWl3aVkyaGhjblJ6SWl3aVptOXliWE1pTENKbWIzSnRkV3hoSWl3aWNHRnljMlZ5SWl3aWNtVnVaR1Z5SWl3aVkyOXRiV1Z1ZEhNaUxDSnBiWEJ2Y25SbGNpSXNJbUpoY2lJc0luWmhiR2xrWVhScGIyNXpJaXdpYzJWaGNtTm9JaXdpY0hKcGJuUWlMQ0p6YUdWbGRITWlMQ0pqYkdsbGJuUWlMQ0p6WlhKMlpYSWlMQ0p6YUdGd1pYTWlYU3dpWkdWdGJ5STZkSEoxWlgwPQ==';
export default {
components: {
Spreadsheet,
Worksheet,
},
methods: {
toggle() {
let worksheet = this.$refs.spreadsheet.current[0];
if (worksheet.table.classList.contains('jss_nogridline')) {
worksheet.table.classList.remove('jss_nogridline');
} else {
worksheet.table.classList.add('jss_nogridline');
}
}
},
data() {
const data = [
['Mazda', 2001, 2000, 1],
['Peugeot', 2010, 5000, 1],
['Honda Fit', 2009, 3000, 1],
['Honda CRV', 2010, 6000, 0],
];
return {
data,
license,
}
}
}
</script>
import { Component, ViewChild, ElementRef } from "@angular/core";
import jspreadsheet from "jspreadsheet";
import "jspreadsheet/dist/jspreadsheet.css"
import "jsuites/dist/jsuites.css"
jspreadsheet.setLicense('ZjJkOTdiYzJjNDI4ZWFmMTcyMWJiY2Y1YTk0NTM1NzA1YWZiYzM5MWIwY2U0ODE0NGM1MzcwZGE0MTdiNTBhMDE3NDg3NWIxZDE5NGIyNjFmY2YxNmJiYWY5YzViMjIxMjViOWU5YWUxYzAzZWMwZDM3MmNmYTQzMThiYmFjZDAsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpRek9EUTJPRGs1TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0ozWldJaUxDSnNiMk5oYkdodmMzUWlYU3dpY0d4aGJpSTZJak0wSWl3aWMyTnZjR1VpT2xzaWRqY2lMQ0oyT0NJc0luWTVJaXdpZGpFd0lpd2lkakV4SWl3aVkyaGhjblJ6SWl3aVptOXliWE1pTENKbWIzSnRkV3hoSWl3aWNHRnljMlZ5SWl3aWNtVnVaR1Z5SWl3aVkyOXRiV1Z1ZEhNaUxDSnBiWEJ2Y25SbGNpSXNJbUpoY2lJc0luWmhiR2xrWVhScGIyNXpJaXdpYzJWaGNtTm9JaXdpY0hKcGJuUWlMQ0p6YUdWbGRITWlMQ0pqYkdsbGJuUWlMQ0p6WlhKMlpYSWlMQ0p6YUdGd1pYTWlYU3dpWkdWdGJ5STZkSEoxWlgwPQ==');
@Component({
selector: "app-root",
template: `<div #spreadsheet></div>
<input type="button" value="toggle" (click)="toggle()" />`,
})
export class AppComponent {
@ViewChild("spreadsheet") spreadsheet: ElementRef;
worksheets: jspreadsheet.worksheetInstance[];
ngAfterViewInit() {
this.worksheets = jspreadsheet(this.spreadsheet.nativeElement, {
toolbar: true,
worksheets: [{
minDimensions: [8,0],
data: [
['Mazda', 2001, 2000, 1],
['Peugeot', 2010, 5000, 1],
['Honda Fit', 2009, 3000, 1],
['Honda CRV', 2010, 6000, 0],
],
}]
});
}
toggle() {
if (this.worksheet[0].table.classList.contains('jss_nogridline')) {
this.worksheet[0].table.classList.remove('jss_nogridline');
} else {
this.worksheet[0].table.classList.add('jss_nogridline');
}
}
}