function arrayToTable(input, rootDocument) {
  var inputLen = input.length;
  var result = ['<table>'];
  var tempElement = rootDocument.createElement('div');
  rootDocument.documentElement.appendChild(tempElement);

  for (var row = 0; row < inputLen; row += 1) {
    var rowData = input[row];
    var columnsLen = rowData.length;
    var columnsResult = [];

    if (row === 0) {
      result.push('<tbody>');
    }

    for (var column = 0; column < columnsLen; column += 1) {
      tempElement.innerText = "".concat((0, _mixed.isEmpty)(rowData[column]) ? '' : rowData[column]);
      columnsResult.push("<td>".concat(tempElement.innerHTML, "</td>"));
    }

    result.push.apply(result, ['<tr>'].concat(columnsResult, ['</tr>']));

    if (row + 1 === inputLen) {
      result.push('</tbody>');
    }
  }

  rootDocument.documentElement.removeChild(tempElement);
  result.push('</table>');
  return result.join('');
}
Converts javascript array into HTMLTable.

@param {Array} input Input array which will be converted to HTMLTable