Replies: 1 comment
|
As I have commented below another post of yours, you should not use \documentclass{article}
\usepackage{tabularray}
\usepackage{calc}
\begin{document}
\newlength\lengtha \setlength\lengtha{0.75\linewidth-0.4pt}
\newlength\lengthb \setlength\lengthb{0.25\linewidth-0.4pt}
\begin{tblr}{colspec={|Q[\lengtha]|Q[\lengthb]|}, hlines, colsep=0pt}
A & B \\
\end{tblr}
\vspace{3mm}
\newlength\lengthc \setlength\lengthc{0.75\linewidth-0.4pt-12pt}
\newlength\lengthd \setlength\lengthd{0.25\linewidth-0.4pt-12pt}
\begin{tblr}{colspec={|Q[\lengthc]|Q[\lengthd]|}, hlines}
A & B \\
\end{tblr}
\vspace{3mm}
\newlength\lengthe \setlength\lengthe{0.75\linewidth-0.4pt-48pt}
\newlength\lengthf \setlength\lengthf{0.25\linewidth-0.4pt-48pt}
\begin{tblr}{colspec={|Q[\lengthe]|Q[\lengthf]|}, hlines, colsep=24pt}
A & B \\
\end{tblr}
\end{document} |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Problem
I'd like to have a table with column ratio of 3:1.
Xcolumns seem to be the right approach as they occupy the remaining width in proportion to their coefficients.Unfortunately, the
colsepdimension is not part of the column width.That's why it is subtracted from the remaining width before the column widths are determined.
This results in different positions of the Vline depending on the
colsepas the following example illustrates.While the first table (with
colsep=0pt) has a Vline-to-Vline ratio of 3:1, the last table (withcolsep=24pt) has a Vline-to-Vline ratio of about 2.3:1.Proposal
My proposal is to include the 'colsep' into the column width such that the Vline-to-Vline ratio is maintained.
(There might be other dimensions like
rulewidththat have to be taken into account to achieve the exact ratio.)All reactions