Is it possible to set all tblr
in the document to be \linewidth
wide specifying the X
column type by default?. This requires not mentioning the number of columns like it happens in colspec
, as it varies for every tblr
.
In this case, colspec
could be used in certain columns where the default column type should be overriden.
For instance:
\documentclass{article}
\usepackage{tabularray}
\setlength{\parindent}{0mm}
% act here to specify a default column type
\SetTblrInner{
width=\linewidth,
%columns={X},
baseline=T,
hspan=even,
vspan=even,
stretch=1.3,
row{1}={font=\bfseries},
hline{1,Z}={0.6mm},
hline{2}={0.3mm}
}
\begin{document}
These tables should all have the same width without further modifications in the document body
\begin{table}[!hb]
\begin{tblr}{colspec={XX}}
Head1 & Head2 \\
Row21 & Row22 \\
Row31 & Row32 \\
\end{tblr}
\begin{tblr}{}
Head1 & Head2 \\
Row21 & Row22Row22 \\
Row31 & Row32 \\
\end{tblr}
\begin{tblr}{}
Head1 & Head2 & Head3\\
Row21 & Row22 & Row23 \\
Row31 & Row32 & Row33 \\
Row41 & Row42 & Row43 \\
\end{tblr}
\begin{tblr}{colspec={|l|X[r]|c|}}
Head1 & Head2 & Head3\\
Row21 & Row22 & Row23 \\
Row31 & Row32 & Row33 \\
Row41Row41 & Row42 & Row43 \\
\end{tblr}
\end{table}
\end{document}
\linewidth
, how are tables with two columns, let alone tables with three or more columns, supposed to fit on a page?width
inSetTblrInner
is referred to the wholetblr
, not to single columnstabularray
package.