How do I change the width of the columns in the Admin listing in Django?

3

How do I specify the width for the columns that are displayed in the Admin listing, more precisely the ones I specify in list_display in admin.py. Searching a similar question here , where I came to the conclusion that I should extend the file change_list.html. So I created a file of the same name in the templates directory of my application with the following excerpt, where 'price' would be my column:

{% extends "admin/change_list.html" %}

{% block extrahead %}
  {{ block.super }}
  <style type="text/css">
    #price { width: 100px; }
  </style>
{% endblock %}

Nothing happened though.

    
asked by anonymous 19.01.2016 / 15:54

1 answer

2

Try to put in style:

th.column-price{width:100px;}
    
20.01.2016 / 12:44