this might look like the most dumb question of all time, but after passing a JSON object to EJS , my table is not dividing the information in cells and rows, but just showing them in one row with comas
this is my code
app.get("/", function (req, res) {
const data = require("./data.json");
var recetas = data;
res.render("pages/index", {
recetas: recetas,
});
});
<head>
<%- include('../partials/head'); %>
</head>
<body class="container">
<header><%- include('../partials/header'); %></header>
<main>
<div class="jumbotron">
<h2>Receta</h2>
<ul>
<% recetas.forEach(function(receta) { %>
<li>
<h1><strong>Nombre</strong></h1>
<p><%= receta.nombre %></p>
<h2><strong>Categoria</strong></h2>
<p><%= receta.categoria %></p>
<h2><strong>Chef</strong></h2>
<p><%= receta.chef %></p>
<table style="width:100% ; border:1px solid black ; border-collapse: collapse;padding: 15px" >
<tbody>
<tr>
</tr>
<tbody>
<tr style="height: 18px ; border: 1px solid black;
border-collapse: collapse;padding: 15px">
<td style="width: 50%; height: 18px; text-align: justify ; border: 1px solid black;
border-collapse: collapse;padding: 15px">
<strong>Ingrediente</strong>
</td>
<td style="width: 50%; height: 18px; text-align: justify">
<strong>Cantidad</strong>
</td>
<tr style="height: 18px ; border: 1px solid black;
border-collapse: collapse;padding: 15px">
<td style="width: 50%; height: 18px; text-align: justify ; border: 1px solid black;
border-collapse: collapse;padding: 15px"> <%= receta.ingredientes.nombre %>
</td>
<td style="width: 50%; height: 18px; text-align: justify ; border: 1px solid black;
border-collapse: collapse;padding: 15px"> <p><%= receta.ingredientes.cantidad %></p>
</td>
</tr>
</tr>
</tbody>
</table>
</li>
<h2><strong>Preparacion</strong></h2>
<textarea id="w3review" name="w3review" rows="4" cols="50">
<%= receta.preparacion %></textarea>
<% }); %>
</ul>
</div>
</main>
<footer><%- include('../partials/footer'); %></footer>
</body>
</html>
that is all of my code and I have no idea how to solve this, im kinda new to web programming so, please help me with this
thanks a lot
question from:
https://stackoverflow.com/questions/65920406/html-table-not-showing-correctly 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…