Thanks for the filter, just thought I'd add to the equation, in case
you need tables sorted down the column instead of across the row.

def transtabularize(value,cols):
    try:
        cols = int(cols)
    except ValueError:
        return [value]
    r = len(value)/cols + (len(value)%cols>0)
    return [[value[j] for j in range(i,len(value),r) ] for i in
range(0,r)]

Reply via email to