Handsontable Basic Example (100x10)

HTML

<script src="https://handsontable.com/bower_components/handsontable/dist/handsontable.full.js"></script>
<link rel="stylesheet" href="https://handsontable.com/bower_components/handsontable/dist/handsontable.full.css">
<div class="some-class">
  <div id="example" class="handsontable"></div>  
</div>

<button id="button">
  Server side columns
</button>

CSS

.some-class > .handsontable .wrapped {
  width: 65px;
}

.some-class > .handsontable thead tr th {
  white-space: normal;
}

.some-class .handsontable thead tr th:not([colspan]) span {
  width: 100%;
  max-width: 95px;
}

JavaScript

var data = [{
    col0: 0,
    col1: 1,
    col2: 'A'
  },
  {
    col0: 0,
    col1: 1,
    col2: 'B'
  },
  {
    col0: 0,
    col1: 1,
    col2: 'C'
  },
  {
    col0: 0,
    col1: 1,
    col2: 'D'
  },
]

var columns = [{
    data: 'col0',
    readOnly: true,
  },
  {
    data: 'col1',
    readOnly: true,
  },
  {
    data: 'col2',
    readOnly: true,
  },
]


var container = document.getElementById('example');

var hot = new Handsontable(container, {
  licenseKey: 'non-commercial-and-evaluation',
  data: data,
  columns: columns,
  rowHeaders: true,
  colHeaders: true,
  nestedHeaders: [
    [{label: 'static column', colspan: 3 }],
    ['Col 0 very long column name', 'Col 1', 'Col 2'].map(
      		col => `<div class="wrapped">${col}</div>`,
    		)
  ],
});

var button = document.getElementById('button')
  .addEventListener('click', function(event) {
    event.preventDefault()
    var serverSideData = {
      fields: ['Server Side Col 0 very long name', 'Server Side Col 1'],
      data: [
      	{col0: 0,col1: 1,col2: 3,ss0: 4,ss1: 5},
      	{col0: 0,col1: 1,col2: 3,ss0: 4,ss1: 5},
      	{col0: 0,col1: 1,col2: 3,ss0: 4,ss1: 5},
      	{col0: 0,col1: 1,col2: 3,ss0: 4,ss1: 5},
      	{col0: 0,col1: 1,col2: 3,ss0: 4,ss1: 5},
      ],
      columns: [
      	{ data: 'col0', readOnly: true },
        { data: 'col1', readOnly: true },
        { data: 'col2', readOnly: true },
        { data: 'ss0',  readOnly: true },
        { data: 'ss1',  readOnly: true },
      ]
    }
    hot.updateSettings({
      columns: serverSideData.columns,
      nestedHeaders: [
        [
        	{ label: 'static column',colspan: 3 },
        	{ label: 'server side', colspan: serverSideData.fields.length}
        ],
        [
        	'Col 0 very long column name', 'Col 1', 'Col 2',
        	...serverSideData.fields
        ].map(
      		col => `<div class="wrapped">${col}</div>`,
    		)
      ]
    })
    
    hot.loadData(JSON.parse(JSON.stringify(serverSideData.data)))
    
   ...