How to change column width in Admin listing in Django?

Question:

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

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

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

However nothing happened.

Answer:

Try putting on the style:

th.column-price{width:100px;}
Scroll to Top