[Answer]-Modifying CSS for a Django Column Width

1👍

The answer is somewhat listed in the comments above. For future readers of this QA:

  1. Do an Inspect Element on the TH in the table to see if your CSS is applied
  2. Check if anothern CSS definition is more specific and therefore overruling your own statement; if so, make yours more specific

The OP has used the grp-text class to style the column. This suggest the presence of Grappelli as skin over the admin. When you aren’t using Grappelli, the class name would be .text.

Overriding the grp-text does not seem to be right because this could mess with other elements that are present in your TH. but for now you’ve got a solution.

0👍

Thanks to some help from Wouter above, I realized that I needed to call out the specific class.

th.sortable.column-project .grp-text {width:50%}.

Leave a comment