I am generating dynamicaly big tables (hundreds of rows and dozens of columns) from python/jinja. I found some solution to make 'subcolumns' widths even: Evenly distributing column widths
So I defined column type:
\newcolumntype{Y}{>{\centering\arraybackslash}X}
the problem is that when number of 'Y' columns reaches 20 the whole table becomes a mess.
full code:
\documentclass{article}
\usepackage[a4paper, landscape, total={11in, 8in}]{geometry}
\usepackage[table]{xcolor}
\usepackage{courier}
\renewcommand*\familydefault{\ttdefault}
\usepackage[T1]{fontenc}
\usepackage{xltabular}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\begin{document}
{
\begin{xltabular}{\textwidth}{ |*{19}{Y|} }
\hline
\rowcolor{lightgray}
\multicolumn{3}{ c| }{first} & \multicolumn{3}{ c| }{second} & \multicolumn{2}{ c| }{third} & \multicolumn{2}{ c| }{fourth} &
\multicolumn{2}{ c| }{fifth} & \multicolumn{2}{ c| }{sixth} & \multicolumn{2}{ c| }{seventh} & \multicolumn{3}{ c| }{eighth}
\\
\hline
\rowcolor{lightgray}
a & b & c & d & e & f & g & h & i & j & k & l & m & n & o & p & q & r & s\\
\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\
\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\
\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9\\
\hline
\end{xltabular}
}
\newpage
\end{document}
In state above with 19 columns the table looks fine:

but if we add just one more Y column:
\begin{xltabular}{\textwidth}{ |*{20}{Y|} }
...
Adding other types of column like 'c' or 'l' does not affect negatively.
Is there some limit that can be omitted by compiler parameter or something?

total={11in, 8in}, I am unable to reproduce the issue you're experiencing after adding a 20th column. – Mico Jul 21 '22 at 14:32tabularxbut I'd never use it for such a table.tabularxis all about adjusting line breaking within cells to control the total width and you have no line breaking here. – David Carlisle Jul 21 '22 at 16:09