Я переписал несколько методов и получил то, что мне нужно
class Vertical(HTMLCalendar):
def formatweekrow(self, theweeks, daynum):
"""
Return a complete week as a table row.
"""
v = []
s = v.append
s('<tr>')
for theweek in theweeks:
for (d, wd) in theweek:
if wd == daynum:
s(self.formatday(d, wd))
s('</tr>')
return ''.join(v)
def formatmonth(self, theyear, themonth, withyear=True):
"""
Return a formatted month as a table.
"""
cnt = 0
v = []
theweeks = self.monthdays2calendar(theyear, themonth)
a = v.append
a('<table border="0" cellpadding="0" cellspacing="0" class="">')
a('\n')
a(self.formatmonthname(theyear, themonth, withyear=withyear))
a('\n')
a(self.formatweekheader())
a('\n')
while cnt < 7:
a(self.formatweekrow(theweeks, cnt))
a('\n')
cnt += 1
a('</table>')
a('\n')
return ''.join(v)