I would like to make the 2nd column text occupy the same as that from the 1st column. That way, the line spacing between the lines needs to be bigger..
-
3how is the reader supposed to read this as a table if there is no row structure? – David Carlisle Nov 11 '21 at 08:10
-
1a hand sketch of the finished product would help – js bibra Nov 11 '21 at 08:22
-
1Welcome to TeX.SE. There's an even number of data rows in the first column and an odd number of data rows in the second. What's the (visual) correspondence between the contents of columns 1 and 2? – Mico Nov 11 '21 at 08:31
-
The reader is not supossed to read this a table where every line corresponds to 1 case. That is the main reason why I want items not to be aligned, as in the image I am sending. I perhaps wrongly omitted the explanation of the table, to focus in the problem I had. – Aurea Iñurritegui Marroquin Nov 11 '21 at 09:07
-
The idea of the table is to show the different values a variable has taken inside a reserch study with hundreds of cases of study. As an example for you to understand, in those 2 columns you see what I want tovisualize is that with I will have the following cases of study: dp36_alpha20 , dp36_alpha30 , dp36_alpha37.5 , dp36_alpha45 , dp50_20 and so on... – Aurea Iñurritegui Marroquin Nov 11 '21 at 09:09
-
1Probably, such a stable is not the ideal way to present that kind of information. Maybe you can use a list instead. – leandriis Nov 11 '21 at 09:40
-
that is you are using a table for non tabular data, not using a table might be a better solution. – David Carlisle Nov 11 '21 at 11:48
2 Answers
As already mentioned @leandriis in his comment, using table in your way can be (is) misleading. I would look for some other way to present values of variables considered in your study cases. One example can be:
\usepackage[skip=1ex]{caption}
\begin{document}
\begin{table}[ht]
\caption{\dots}
\label{tab:values-1}
\centering
\begin{tabular}{rl}
\toprule
variables & \multicolumn{1}{c}{selected values}
\
\midrule
$d_p$ [mm] & 36, 43, 50, 75, 100, 200, 400 \
$\alpha$ [\si{\degree}]
& 20, 30, 30.7, 45 \
\bottomrule
\end{tabular}
\end{table}
\end{document}
However, table as you like to have, can be simple achieve by tabularray package:
\documentclass{article}
\usepackage{siunitx}
\usepackage{tabularray}
\UseTblrLibrary{booktabs}
\usepackage[skip=1ex]{caption}
\begin{document}
\begin{table}[ht]
\caption{\dots}
\label{tab:values-1}
\centering
\begin{tblr}{colspec={Q[l,wd=4em]l},
vspan=even}
\toprule
$d_p$ [mm] & $\alpha$ [\si{\degree}] \
\midrule
\SetCell[r=4]{l}
36\par
43\par
50\par
75\par
100\par
200\par
400 & 20 \
& 30 \
& 30.7 \
& 45 \
\bottomrule
\end{tblr}
\end{table}
\end{document}
- 296,517
-
I think you are right with my table misleading this type of information. Thanks for the proposal! – Aurea Iñurritegui Marroquin Nov 11 '21 at 11:26
This seems similar to Identical spacing of inference lines with Bussproofs.
Because there is no 1:1 correspondence between the rows in the first and the second column, this is a vertical rather than a horizontal alignment. It can be achieved in plain TeX
\def\cell#1{\hbox to 5pc{\strut $#1$\hfil}}
\leftline{\valign{&\cell{#}\cr
\omit\hrule&d_p\;[mm]&\omit\hrule&36&43&50&75&100&200&400&\omit\hrule\cr
\omit\hrule&\alpha\;[{}^\circ]&\omit\hrule&
\multispan{7}{\cell{20}\vfil\cell{30}\vfil\cell{37.5}\vfil\cell{45}}&\omit\hrule\cr
}}
but it is probably also possible with LaTeX.
In general, place the values in the second column (the one with fewer values) inside the \multispan{7}, separated by \vfil:
\multispan{7}{\cell{...}\vfil\cell{...}\vfil...\vfil\cell{...}}
And the number after the \multispan is the number of values in the first column (the one with most values).
- 1,816
-
How about if instead of 4 elements in the 2nd column I have 5? – Aurea Iñurritegui Marroquin Nov 11 '21 at 09:04
-
-
Thank you very much Heiko!! When watching your comment I thought my problem was finally solved, however it does not work for me. I am using Overleaf, and perhaps that is the reason for your code not forking for me?? – Aurea Iñurritegui Marroquin Nov 11 '21 at 09:29
-
Could be, my solution is based on plain TeX. I hope that other experts here can "translate" my solution to LaTeX/Overleaf. – Heiko Theißen Nov 11 '21 at 09:33
-
1the fragment would work in latex, just remove
\bye(which is plain tex for\end{document}@AureaIñurriteguiMarroquin – David Carlisle Nov 11 '21 at 09:47



