You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
warnings.warn(f"As a string, `colalign` is interpreted as {[cforcincolalign]}. Did you mean `colglobalalign = \"{colalign}\"` or `colalign = (\"{colalign}\",)`?", stacklevel=2)
2250
+
warnings.warn(
2251
+
f"As a string, `colalign` is interpreted as {[cforcincolalign]}. "
2252
+
f'Did you mean `colglobalalign = "{colalign}"` or `colalign = ("{colalign}",)`?',
_align_column(c, a, minw, has_invisible, enable_widechars, tablefmt.multiline)
@@ -2250,20 +2272,25 @@ def tabulate(
2250
2272
# align headers and add headers
2251
2273
t_cols=colsor [[""]] *len(headers)
2252
2274
# first set global alignment
2253
-
ifheadersglobalalignisnotNone: # if global alignment provided
2275
+
ifheadersglobalalignisnotNone: # if global alignment provided
2254
2276
aligns_headers= [headersglobalalign] *len(t_cols)
2255
-
else: # default
2277
+
else: # default
2256
2278
aligns_headers=alignsor [stralign] *len(headers)
2257
2279
# then specific header alignements
2258
2280
ifheadersalignisnotNone:
2259
2281
assertisinstance(headersalign, Iterable)
2260
2282
ifisinstance(headersalign, str):
2261
-
warnings.warn(f"As a string, `headersalign` is interpreted as {[cforcinheadersalign]}. Did you mean `headersglobalalign = \"{headersalign}\"` or `headersalign = (\"{headersalign}\",)`?", stacklevel=2)
2283
+
warnings.warn(
2284
+
f"As a string, `headersalign` is interpreted as {[cforcinheadersalign]}. "
2285
+
f'Did you mean `headersglobalalign = "{headersalign}"` '
2286
+
f'or `headersalign = ("{headersalign}",)`?',
2287
+
stacklevel=2,
2288
+
)
2262
2289
foridx, aligninenumerate(headersalign):
2263
2290
hidx=headers_pad+idx
2264
2291
ifnothidx<len(aligns_headers):
2265
2292
break
2266
-
elifalign=="same"andhidx<len(aligns): # same as column align
2293
+
elifalign=="same"andhidx<len(aligns): # same as column align
0 commit comments