new_contents: from django import template
  register=template.Library()
  
  @register.filter
  def autowidth(lst, total=100.0):
     if hasattr(lst, '__len__'): lst=lst.__len__()
     if not isinstance(lst, float): lst=float(lst)
     return round(total/lst, 1)
  
subject: Add the autowidth templatetag. It is used to calculate the width when you want to distribute the elements