Leaving all highlighted column (Django + template)

2

I'm trying to make the entire column colorful, but only the last line is getting.

I've tried all the possible logic, but I'm not getting it right.

This post is a continuation of Total and subtotal in django template using lists .

views.py

...
    # loja mais barata
    loja_mais_barata = min(linhas[-1][1:])[3]
...

template.html

<tbody>
{% for linha, mais_barato in linhas_mais_barato %}
  {% if linha.0 == 'Subtotal' %}
    <tr class="info" style="font-weight: bold;">
  {% else %}
    <tr>
  {% endif %}
    {% for item in linha %}
      {% if forloop.first %}
        <td>{{ item }}</td>
      {% elif forloop.last %}
      {% else %}
        {% if item.3 == loja_mais_barata %}
          <td>OK</td>
        {% else %}
          <td>{{ item.0 }}</td>
        {% endif %}
        <td>{{ item.1 }}</td>
        <td>{{ item.2 }}</td>
      {% endif %}
    {% endfor %}
  </tr>
{% endfor %}
  <tr>
    {% for item in cabecalho %}
      {% if forloop.first %}
        <th>   </th>
      {% else %}
        <td class="text-center">Preço</td>
        <td class="text-center">Quant.</td>
        <td class="text-center" style="border-right: 1px dashed #333;">Total</td>
      {% endif %}
    {% endfor %}
  </tr>
  <tr>
    {% for item in cabecalho %}
      {% if forloop.first %}
        <th>{{ item }}</th>
      {% else %}
        <th class="text-center"></th>
        <th class="text-center">{{ item }}</th>
        <th class="text-center"></th>
      {% endif %}
    {% endfor %}
  </tr>
</tbody>

    
asked by anonymous 24.12.2015 / 07:37

1 answer

-1

If you want to leave the entire colored column do the following:

<td class="color">Total</td>

style.css:

td{
    text-align: center;
}

#color{
    border: 2px dashed #333;
    background: #6AE49C;
}

Apparently it will work.

    
18.01.2016 / 02:10