SpreadSheet for LiaScript: Excel-Style Interactive Tables in Your Course
- André Dietrich
- Template , Tutorial
- May 28, 2026
Interactive data tables are a staple of business, science, and data literacy education. The SpreadSheet template brings JSSpreadsheet (jspreadsheet.js) into LiaScript, enabling student-editable tables with Excel-style formulas, dropdown selectors, checkboxes, sorting, search, and persistence — all without a server.
Quick Start
<!--
import: https://raw.githubusercontent.com/LiaTemplates/SpreadSheet/refs/heads/main/README.md
-->
Macro: @spreadsheet (in fence header)
Place @spreadsheet in the header of a JSON code block.
The JSON block defines worksheets, column types, and data.
```json @spreadsheet
{
"worksheets": [{
"data": [
["Task", "Owner", "Done?"],
["Write course", "You", true],
["Review draft", "Me", false]
],
"columns": [
{ "type": "text", "title": "Task", "width": 200 },
{ "type": "dropdown", "title": "Owner", "source": ["You","Me","Both"] },
{ "type": "checkbox", "title": "Done?" }
],
"worksheetName": "Project Tracker"
}]
}
```
Try it live — edit cells, toggle checkboxes, and select owners from the dropdown:
Column Types
| Type | Description |
|---|---|
"text" | Free text input |
"numeric" | Number input (right-aligned) |
"dropdown" | Select from list (use "source": [...]) |
"checkbox" | Boolean toggle |
"calendar" | Date picker |
"image" | Image URL cell |
"color" | Color picker |
Excel Formulas
JSSpreadsheet supports Excel-style formulas.
Write formulas as cell content in "data":
```json @spreadsheet
{
"worksheets": [{
"data": [
["Q1", "Q2", "Q3", "Q4", "Total"],
[1200, 1400, 900, 1600, "=SUM(A2:D2)"],
[800, 1100, 750, 1300, "=SUM(A3:D3)"],
["=SUM(A2:A3)", "=SUM(B2:B3)", "=SUM(C2:C3)", "=SUM(D2:D3)", "=SUM(E2:E3)"]
],
"columns": [
{ "type": "numeric", "title": "Q1" },
{ "type": "numeric", "title": "Q2" },
{ "type": "numeric", "title": "Q3" },
{ "type": "numeric", "title": "Q4" },
{ "type": "numeric", "title": "Total" }
],
"worksheetName": "Sales Data"
}]
}
```
Try it live — edit the quarterly numbers and watch the SUM formulas update automatically:
Multiple Worksheets
Add more objects to the "worksheets" array:
```json @spreadsheet
{
"worksheets": [
{
"data": [["Name","Score"],[" Alice",95],["Bob",82]],
"columns": [{"type":"text","title":"Name"},{"type":"numeric","title":"Score"}],
"worksheetName": "Class A"
},
{
"data": [["Name","Score"],[" Carol",88],["Dave",76]],
"columns": [{"type":"text","title":"Name"},{"type":"numeric","title":"Score"}],
"worksheetName": "Class B"
}
]
}
```
Persistence
Add persistent: true to the LiaScript slide header to save student edits:
# My Sheet
<!-- persistent: true -->
@spreadsheet
The data is stored in localStorage and restored on the next visit.
Full Template Demo
Use Cases
Data literacy and statistics — Students enter and calculate with real datasets using familiar spreadsheet interaction. Formulas make the calculations transparent and editable.
Business and economics courses — Budget simulations, break-even analysis, and financial modeling without needing Excel.
Science labs — Enter measurement results in a structured table; formulas compute averages, standard deviation, and error margins.
Project management training — Use checkbox and dropdown columns for task assignment and status tracking exercises.
Language and humanities — Use text columns for vocabulary tables, grammar tables, and annotation matrices.
Technical Facts
| Runs in browser | Yes — fully client-side |
| Server required | No |
| Formulas | Yes — Excel-compatible |
| Multiple sheets | Yes — tabs |
| Search & sort | Yes — built in |
| Persistence | Yes — persistent: true |
| Column types | text, numeric, dropdown, checkbox, calendar, image, color |
| Based on | JSSpreadsheet (jspreadsheet.js) |
| License | MIT |
| Maintained | Version 0.0.1 |
Try It
Try in LiaScript Open in LiveEditor View on GitHubRelated Templates
- Random — randomized exercise pools from larger question banks
- TextAnalysis — analyze and grade text complexity
- Chart.js — visualize spreadsheet data as bar, line, or pie charts