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

155
Visualizações
Hiding NULL column when displaying them in multiple table using javascript express.js

This following is the data in my sql
data
i am trying to display the data individually into a html page in multiple table form. My expectation is the following
enter image description here
The NULL row need to exclude in the table.(ignore the caps)


right now i am only able to pass the the entire data into a table. the following is my code in html
<% availableItem.forEach(function(parameter1){ %>
    <tr>
    <td> <%= parameter1.Name %> </td>
    <td><%= parameter1.ONE %></td>
    <td><%= parameter1.TWO %></td>
    <td><%= parameter1.THREE %></td>
    <td><%= parameter1.FOUR %></td>
    <% }) %>

here is my code in javascript

app.get("/display", function (req, res) {
    // query database to get all the appliances
    let sqlquery = "SELECT * FROM table";
    // execute sql query
    db.query(sqlquery, (err, result) => {
        if (err) {
            res.redirect("/");
        }
        res.render("display.html", { availableItem,: result });

    });

});

Do i need to create a loop or something to do this? can anyone advice?

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