Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

160
Visualizações
Removing numbered columns using alaSql

I'm trying to do an xlsx export using alasql, everything works perfectly except my columns are numbered for some reason, and I can't seem to find those numbers in any of the arrays I'm using.

This is my current code:

var myTableArray1 = [];
        $("table#tableMain1 tr").each(function () {
            var arrayOfThisRow = [];
            var tableData = $(this).find('td');
            if (tableData.length > 0) {
                tableData.each(function () { arrayOfThisRow.push($(this).text()); });
                myTableArray1.push(arrayOfThisRow);
                
            }
        });
        
        console.log(myTableArray1);


        var myTableArray2 = [];
        $("table#tableMain2 tr").each(function () {
            var arrayOfThisRow = [];
            var tableData = $(this).find('td');
            if (tableData.length > 0) {
                tableData.each(function () { arrayOfThisRow.push($(this).text()); });
                myTableArray2.push(arrayOfThisRow);
                
            }
        });
        
        console.log(myTableArray2);

        

        window.saveFile = function saveFile() {
            var data1 = [];
            var data2 = [];

            myTableArray1.forEach((n, i) => { data1.push(n) });
            myTableArray2.forEach((n, i) => { data2.push(n) });
            console.log(data1);
            console.log(data2);

            var opts = [{ sheetid: 'ONE', header: true }, { sheetid: 'TWO', header: false }]

            var res = alasql('SELECT INTO XLSX("(@Model.Account).xlsx",?) FROM ?', [opts, [data1, data2]]);

What I have in the xlsx looks like this: xlsx formatting

What I have tried:

data1.shift(); //removes actual column names on data1 
data2.shift(); //removes actual column names on data2

myTableArray1.shift(); //same outcome as above
myTableArray2.shift(); //same outcome as above

var opts = [{ sheetid: 'ONE', header: true, range:"A2:Z" }, { sheetid: 'TWO', header: false, range:"A2:Z" }] //moves everything down by one row
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda