Search code examples
thymeleaf

List details of a order


someone's here knows why happened this?

enter image description here

I'm trying to list the details of a order

this is the block html

    <div class="row">
        <h1>Lista de Pedidos</h1>
    </div>
    <table class="table table-striped table-bordered" id="myTable">
        <thead class="table-dark">
            <tr>
                <th class="titulotb" scope="col">#</th>
                <th class="titulotb" scope="col">Nombre del cliente</th>
                <th class="titulotb" scope="col">Total</th>
                <th class="titulotb" scope="col">Fecha</th>
                <th class="titulotb" scope="col">Mesero</th>
                <th class="titulotb" scope="col">Detalles</th>
            </tr>
        </thead>
        <tbody>

            <tr th:each="order : ${Order}">
                <th th:text="${order.id_Ped}" scope="row"></th>
                <td th:text="${order.Name_cli}"></td>
                <td th:text="${order.Total}"></td>
                <td th:text="${order.Fecha}"></td>
                <td th:text="${order.id_usu_fk.nom}"></td>
                   <td>
                   
                   <table class="table table-bordered">
                     <thead>
                     <tr>
                       <th>Cantidad</th>
                       <th>Subtotal</th>
                       <th>Producto</th>
                     </tr>
                     </thead>
                     <tbody>
                       <tr th:each="det : ${order.detalles}">
                         <td th:text="det.cant"></td>
                         <td th:text="det.sub"></td>
                         <td th:text="det.id_prod_fk.nom"></td>
                       </tr>
                     </tbody>
                   </table>
                   </td>
            </tr>
        </tbody>
    </table>

</div>

please i need help

I tried with the constructors but nothing happend


Solution

  • I already resolved it, It was a little but important thing

    I just put this ${} in the second table, th:text, look

    enter image description here