assets/js/function.js
/**
 * Insert a column left/right a specified column
 *
 * @param {Boolean} left Checks weather column needs to be added on left of the specified column.
 */
Insert a column left/right a specified column
@param {Boolean} left Checks weather column needs to be added on left of the specified column.
Insert a column left / right a specified column @param { Boolean } left Checks weather column needs to be added on left of the specified column .
function insertCol(left = false) {
  const insertIndex = left
    ? currentColHeaderIndex
    : Number(currentColHeaderIndex) + 1;
  const getColumn = document.querySelector(".col-parent");
  const newColHeader = createColCell(colSize);
  getColumn.append(newColHeader);
  const getAllRows = document.querySelectorAll(".row-parent");
  for (let row = 0; row < rowSize; row++) {
    const newCol = createRowCell(row, colSize);
    getAllRows[row].append(newCol);
  }
  colSize++;
  spreadSheet.forEach((row) => {
    row.splice(insertIndex, 0, "");
  });
  updateUI();
}
function insertCol ( left = false ) { const insertIndex = left ? currentColHeaderIndex : Number ( currentColHeaderIndex ) + 1 ; const getColumn = document . querySelector ( ".col-parent" ) ; const newColHeader = createColCell ( colSize ) ; getColumn . append ( newColHeader ) ; const getAllRows = document . querySelectorAll ( ".row-parent" ) ; for ( let row = 0 ; row < rowSize ; row ++ ) { const newCol = createRowCell ( row , colSize ) ; getAllRows [ row ] . append ( newCol ) ; } colSize ++ ; spreadSheet . forEach ( ( row ) => { row . splice ( insertIndex , 0 , "" ) ; } ) ; updateUI ( ) ; }
Insert a column left/right a specified column
 @param {Boolean} left Checks weather column needs to be added on left of the specified column.
Insert a column left / right a specified column @param { Boolean } left Checks weather column needs to be added on left of the specified column .
// console.log("insertColIndex ", insertIndex);