Seems like a simple task yet I haven't found a simple solution yet. My data sometimes comes as an empty array so that the user can start working off of an empty table (except for the headers). The table has a minSpareRows:1
so I was hoping the table would appear with that spare row and nothing else but instead it goes entirely blank.
Any ideas on how to instantiate a table with just the spare row and the column headers?
Things I've tried include manually inserting a row if the data array is empty however this leads to there being an empty row plus a spare row.
You can use minRows
and minCols
to instantiate an empty Handsontable instance. Also, the data
arguments expects an array of arrays, so in your case when you receive an empty array, just wrap it in another one:
data : Array of Arrays (default [ [] ])
Here's a working JSFiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With