首页 > 解决方案 > 我的表格内容开始很好,然后在一行中全部搞砸了(Node.js,MongoDB)

问题描述

这就是我所说的:

桌子

为什么会这样?是造型问题吗?我尝试为 tr 和 tds 添加一些宽度,它看起来一样。

这是HTML:

<div style="overflow-x:auto">
<table>
    <thead>
        <tr>
            <th>ID</th>
            <th>Nombre</th>
            <th>Apellido</th>
            <th>Mail</th>
            <th>Confirmado</th>
        </tr>
    </thead>
<% personas.forEach(function(personas){ %>
    <tbody>
        <tr>
            <td><%=personas.id%></td>
            <td><%=personas.nombre%></td>
            <td><%=personas.apellido%></td>
            <td><%=personas.email%></td>
            <td><%=personas.confirmado%></td>
        </tr>
    </tbody>
</table>
  </div>

标签: htmlcssnode.jsmongodbhtml-table

解决方案


foreach 的结尾必须在</tbody>和之间</table>


推荐阅读