Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

420
Vistas
How to put objects in column in Django templates

I'm developing an ecommerce project. It's my first time with Django, so be patient. I have some objects in a list, whith so many fields. I want to put this object in column in my template. I tried with the but in a for loop it doesn't recognize more than one div. Is there a method to incolumn my object in my template? Here's my code: enter image description here enter image description here

enter image description here

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Here there is nothing to do from backend. you need to handle it in frontend. You can use a table to display the data as shown below

<table>
    <thead>
        <th>Nome</th>
        <th>Codice</th>
        <th>produttore</th>
        ....
    </thead>
    <tbody>
        {% for l in listprodotti %}
        <tr>
            <td>{{l.nome}}</td>
            <td>{{l.codice_prodotto}}</td>
            <td>{{l.prodottore}}</td>
            ....
        <tr>
        {% ednfor %}
    </tbody>
</table>

For adding extra styles check bootstrap

If you dont want to display them in a table, you can enclose the for loop in a div and add the below css.

<div class="card">
    {% for l in listprodotti %}
     <div>
       ...  
     </div>  
    {% ednfor %}
</div>

#in styles (css) file

.card{
    display: flex;
    gap:15px;
    flex-wrap: wrap;
}
about 4 years ago · Santiago Trujillo Denunciar

0

You didn't write what you're using for the front end, but maybe Bootstrap would be a good alternative.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda