title: Getting Started with Jspreadsheet CE v4 keywords: Jspreadsheet CE, Jexcel, JavaScript data grid, spreadsheets, JavaScript tables, Excel-like data grids, web-based spreadsheets, interactive data grid controls, spreadsheet features description: Learn how to create and manage data grids with powerful spreadsheet controls using Jspreadsheet CE v4. canonical: https://bossanova.uk/jspreadsheet/v4/docs/getting-started # Getting started Jspreadsheet is a vanilla javascript plugin to embed a online spreadsheet in your web based applications. Bring highly dynamic datasets to your application and improve the user experience of your software. ## Install ### NPM ```bash npm install jspreadsheet-ce@4 ``` ### CDN Use jspreadsheet directly from JSDelivr CDN {.ignore} ```html ``` ### GitHub Download from our GitHub page [https://github.com/jspreadsheet/ce](https://github.com/jspreadsheet/ce) ## Initialization You can initiate an online spreadsheet including data from a HTML table, a JS array, a CSV or a JSON file, following the examples below: ### Loading from a javascript array ```html
``` ### Loading from a JSON file ```html
``` ### Loading from a CSV file ```html
``` [See a working example](/jspreadsheet/v4/examples/import-data) ### Headers from a CSV file If you are loading your data from a CSV file, you can define the **csvHeader:true**, so the first row will be used as your column names. [See a working example](/jspreadsheet/v4/examples/import-data) ### Programmatically header updates The methods **setHeader()**, **getHeader()** and **getHeaders()** are available for the developer to interact programmatically with the spreadsheet. [Working example](/jspreadsheet/v4/examples/headers#Programmatically-header-updates) ### Nested headers The nested headers area available in the innitialization through the directive **nestedHeaders:[]**, and should be use follow: ```html
``` [See this example in action](/jspreadsheet/v4/examples/headers) ## Column width The initial width can be defined in the width property in the column parameter. ```html
``` ### Programmatically column width updates The methods setWidth(), getWidth() are available for the developer to update the column width via javascript. [See this example in action](/jspreadsheet/v4/examples/programmatically-updates#setWidth) ## Row height The initial row height can be defined in the height property include in the rows directive. It is also possible to enabled a resizeble row by using rowResize: true in the initialization. ```html
``` ### Programmatically row height updates The methods setHeight(), getHeight() are available for the developer to update the row height via javascript. [See this example in action](/jspreadsheet/v4/examples/programmatically-updates#setHeight) ## Column types Jspreadsheet has available some extra native column types in addition to the default input text. It means you have extended nice responsive ways to get data into your spreadsheet. In addition to that is available integration methods to facilitate you to bring any custom column to your tables. This makes the Jspreadsheet plugin a very flexible tool to enhance the user experience of your applications. Jspreadsheet is integrate with jSuites, so it brings some native columns, such as: **text, numeric, hidden, dropdown, autocomplete, checkbox, radio, calendar, image and color.**_ {.ignore} ```html
``` ### Calendar type When using the calendar column, you can change the behavior behavior of your calendar by sending some extra options as example above. The possible values are: {.ignore} ```javascript { options : { // Date format format:'DD/MM/YYYY', // Allow keyboard date entry readonly:0, // Today is default today:0, // Show timepicker time:0, // Show the reset button resetButton:true, // Placeholder placeholder:'', // Translations can be done here months:['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], weekdays:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], weekdays\_short:['S', 'M', 'T', 'W', 'T', 'F', 'S'], // Value value:null, // Events onclose:null, onchange:null, // Fullscreen (this is automatic set for screensize < 800) fullscreen:false, } } ``` [See a working example](/jspreadsheet/v4/examples/date-and-datetime-picker) ### Dropdown and autocomplete type There are different ways to work with dropdowns in Jspreadsheet. It is possible to define the parameter _source_ as a simple or key-value array. It is also possible to use the param _url_ to populate your dropdown from an external json format source. In addition to that it is possible to have conditional values. Basically, the values from one dropdown can be conditional to other dropdowns in your table. You can set the autocomplete dropdown through the initial param _autocomplete:true_ and the multiple picker can be activate by _multiple:true_ property as shown in the following example: {.ignore} ```html
``` [See a working example](/jspreadsheet/v4/examples/dropdown-and-autocomplete) ### Custom type Jspreadsheet makes possible to extend third party javascript plugins to create your custom columns. Basically to use this feature, you should implement some basic methods such as: openEditor, closeEditor, getValue, setValue as following. {.ignore} ```html
``` [See a working example](/jspreadsheet/v4/examples/column-types#custom) ## Define a minimum table dimension size. The follow example will create a data table with a minimum number of ten columns and five rows: {.ignore} ```html