Nested headers

jExcel spreadsheet implements nested headers natively though the directive nestedHeaders

Programmatically header updates

There are a few options to allow the user to interact with the header titles. Using the contextMenu over the desired header, by pressing an selected header and holding the click for 500ms, or via javascript.

Source code

<script src="https://jexcel.net/v5/jexcel.js"></script>
<script src="https://jexcel.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jexcel.net/v5/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://jexcel.net/v5/jexcel.css" type="text/css" />

<div id="spreadsheet"></div>

var data = [
    ['BR', 'Cheese', 1],
    ['CA', 'Apples', 0],
    ['US', 'Carrots', 1],
    ['GB', 'Oranges', 0],

table = jexcel(document.getElementById('spreadsheet'), {
    columns: [
            type: 'autocomplete',
            title: 'Country',
            width: '300',
            url: '/jexcel/countries'
            type: 'dropdown',
            title: 'Food',
            width: '150',
            source: ['Apples','Bananas','Carrots','Oranges','Cheese']
            type: 'checkbox',
            title: 'Stock',
                title: 'Supermarket information',
                colspan: '3',
                title: 'Location',
                colspan: '1',
                title: ' Other Information',
                colspan: '2'
    license: '39130-64ebc-bd98e-26bc4',

<select id='columnNumber'>
<option value="0">Column 0</option>
<option value="1">Column 1</option>
<option value="2">Column 2</option>

<input type='button' value='Set' onclick="table.setHeader(document.getElementById('columnNumber').value)" />
<input type='button' value='Get' onclick="table.getHeader(document.getElementById('columnNumber').value)" />


Programmatically update nested headers

Method Description
updateNestedHeader = function(x, y, properties) Update the colspan, rowspan or title from the one nestedHeader coordinates (x, y)