File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -2234,11 +2234,12 @@ def tabulate(
22342234 # then specific header alignements
22352235 if headersalign is not None :
22362236 assert isinstance (headersalign , Iterable )
2237- for idx , align in enumerate (headersalign [:len (aligns )]):
2238- if align == "same" : # same as column align
2239- aligns_headers [headers_pad + idx ] = aligns [headers_pad + idx ]
2237+ for idx , align in enumerate (headersalign [:len (aligns_headers )]):
2238+ hidx = headers_pad + idx
2239+ if align == "same" and hidx < len (aligns ): # same as column align
2240+ aligns_headers [hidx ] = aligns [hidx ]
22402241 elif align != "global" :
2241- aligns_headers [headers_pad + idx ] = align
2242+ aligns_headers [hidx ] = align
22422243 minwidths = [
22432244 max (minw , max (width_fn (cl ) for cl in c ))
22442245 for minw , c in zip (minwidths , t_cols )
You can’t perform that action at this time.
0 commit comments