Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!