Rowspan and grouping in Django template

I have many rows in a queryset. Many of the rows share the same value in two fields. I want to show the entire queryset in a table but I don't want to print those values which are the same multiple