Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

419
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda