0

estoy tratadon de crear un template en django pero cuando lo renderizo la tabla se sale del borde. y cuando lo abro en google chrome se ve como si no hubiera archivo de de estilo cusndo estoy usando bootstrap

aqui el html

  <body class=" bg-dark row align-items-center justify-content-center vh-100 ">
    <main>
      <div class="container col-xl-10 col-xxl-8 px-4 py-5">
        <div class="row align-items-center g-lg5 py-5">
          <div class="col-md-11 mx-auto col-lg-5">
            <form class="p-5 p-md-5 border rounded-3 bg-light">
              <hr class="my-4" />
                <div class="row align-items-center justify-content-center">
                  <table class="table table-sm table-bordered">
                    <thead>
                      <tr>
                        <th scope="col">#</th>
                        <th scope="col">Nombre</th>
                        <th scope="col">Fecha</th>
                        <th scope="col">Descripcion</th>
                        <th scope="col">Categoria</th>
                        <th scope="col">Importe</th>
                      </tr>
                    </thead>
                    <tbody>
                      {% for gasto in object_list %}

                      <tr>
                        <th scope="row">1</th>
                        <td>{{ gasto.nombre }}</td>
                        <td>{{ gasto.fecha }}</td>
                        <td>{{ gasto.descripcion }}</td>
                        <td>{{ gasto.categoria }}</td>
                        <td>{{ gasto.importe }}</td>
                      </tr>
                      {% endfor %}
                    </tbody>
                  </table>
                </div>
            </form>
          </div>
        </div>
      </div>
    </main>
  </body>


y aqui la vista en django

class GastoListView(ListView):
    model = Gasto
    template_name = 'gasto/gastos_list.html'
    ordering = 'fecha' 

la verdad no se como solucionarlo y espero me puedan ayudar

2
  • Como tienes el css, añade eso también
    – Luis
    el 24 nov. 2022 a las 23:22
  • Según el tutorial, todo el template se hizo en esa plantilla. Nunca se hizo un documento css el 25 nov. 2022 a las 0:35

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.