tabularray icon indicating copy to clipboard operation
tabularray copied to clipboard

Other ways to distribute space for X columns

Open lvjr opened this issue 1 year ago • 8 comments

Discussed in https://github.com/lvjr/tabularray/discussions/362

Originally posted by note286 February 4, 2023

\documentclass{article}
\usepackage{showframe}
\usepackage{tabularray}
\begin{document}
\begin{table}
\centering
\caption{title}
\begin{tblr}
{
colspec = {*{6}{l}},
% colsep  = 7.5pt,
colsep  = 0pt,
hlines,vlines
}
Lorem     & ipsum      & dolor        & sit     & amet    & consectetur \\
tempor    & incididunt & ut           & labore  & et      & dolore      \\
quis      & nostrud    & exercitation & ullamco & laboris & nisi        \\
consequat & Duis       & aute         & irure   & dolor   & in          \\
cillum    & dolore     & eu           & fugiat  & nulla   & pariatur    \\
proident  & sunt       & in           & culpa   & qui     & officia     \\
\end{tblr}
\end{table}
\end{document}

image

In the table above, we set colsep = 0pt. I hope tblr can automatically complete the setting of colsep so that the table width is the specified width, such as \textwidth.

image

I try to set colsep = 7.5pt to meet the demand in this example. But this is inconvenient and not accurate. Whether there is a method to automatically complete this step. If you can provide an interface, such as width = \textwidth, colsep = autofill, it will be even better.

I know the existence of the X column format, but I don't want this. In many cases, the proportion between columns is not easy to see, so it is not very convenient to use the X column format. All I want is to set colsep automatically.

lvjr avatar Feb 11 '23 04:02 lvjr