Create New Column

Tags: #<Tag:0x00007efc72f80e88>

how to create new column by index ??

Hi @kunal

You can use alter() method to achieve this goal.


Example https://jsfiddle.net/7r4c3dsy/3/

Does it work for you?

actually… i tried in this way… but im not getting exactly result

hot1.alter(‘insert_col’,indexCol, 1,) when im using this previous column data assign to new column…

hot1.alter(‘insert_col’,parseInt(colIndex), 1,) when im using in this way perfectly exucution

how to give column name ??

In your example you use ‘indexCol’ and then ‘colIndex’, they may differ.

Here I am setting to index to 0 (first column) and it works the same for both scenarios
Demo https://jsfiddle.net/Lhvs3165/

how to give column name ??

Column names are added via colHeaders array. Example https://jsfiddle.net/Lhvs3165/2/