5 Answers
In OpTeX, we can use \vspan macro, as described in the documentation, page 16.
\fontfam[lm]
\sans\rm
\table{4{c|}}{\crl
\vspan2{x=1} & abc & xyz & asd, \crlp{2-3}
& bcd & qwe & pqr \crl
\vspan2{x=2} & abc & xyz & asd, \crlp{2-3}
& bcd & qwe & pqr \crl
\vspan2{x=3} & abc & xyz & asd, \crlp{2-3}
& bcd & qwe & pqr \crl
\vspan2{x=4} & abc & xyz & asd, \crlp{2-3}
& bcd & qwe & pqr \crl
}
\bye
-
1Note, that the question doesn't mention LaTeX, so the answers can be based on various TeX formats. There isn't LaTeX only. So, the negative votes are unair. Maybe, somebody dislikes OpTeX.wipet– wipet2023-07-26 06:17:36 +00:00Commented Jul 26, 2023 at 6:17
Here's a solution that employs a single tabular environment.
\documentclass{article}
\usepackage{array} % for '\extrarowheight' parameter and 'w' column type
\usepackage{multirow} % for '\multirow' macro
\usepackage{arev} % optional: sans-serif text and math fonts
\begin{document}
\begin{center}
\setlength\extrarowheight{2pt} % default: 0pt
\begin{tabular}{ wc{1.5cm} | wl{1.5cm} | wl{1.5cm} | wc{1.5cm} | }
\hline
\multirow{2.2}{*}{x=1} & abc & xyz & asd, \\
\cline{2-3}
& bcd & qwe & pqr \\
\hline
\multirow{2.2}{*}{x=2} & abc & xyz & asd, \\
\cline{2-3}
& bcd & qwe & pqr \\
\hline
\end{tabular}
\end{center}
\end{document}
-
The solution given above uses a uniform width of 1.5cm for all 4 columns. Obviously, you're free to choose other, possibly more suitable, column width values.Mico– Mico2023-07-24 19:53:44 +00:00Commented Jul 24, 2023 at 19:53
Solution with use of the tabularray package:
\documentclass[margin=3mm]{standalone}
\usepackage{tabularray}
\usepackage{arev} % optional: sans-serif text and math fonts
\begin{document}
\begin{tblr}{hline{odd} = solid, hline{even} = {2-3}{solid},
vline{2-Z} = solid,
colspec = {Q[c, wd=15mm, mode=math] *{3}{Q[c, wd=15mm]}},
cell{odd}{1} = {r=2}{} % multi row cells
}
x=1 & abc & xyz & asd, \\
& bcd & qwe & pqr \\
x=2 & abc & xyz & asd, \\
& bcd & qwe & pqr \\
x=3 & abc & xyz & asd, \\
& bcd & qwe & pqr \\
x=4 & abc & xyz & asd, \\
& bcd & qwe & pqr \\
\end{tblr}
\end{document}
Addendum: or by small variation of above MWE where in last column are used multirow cells too:
\documentclass[margin=3mm]{standalone}
\usepackage{tabularray}
\usepackage{arev}
\begin{document}
\begin{tblr}{hlines, vline{2-Z} = solid,
colspec = {Q[c, wd=15mm, mode=math] *{3}{Q[c, wd=15mm]}},
cell{odd}{1,Z} = {r=2}{} % multi row cells
}
y=1 & abc & xyz & {asd,\\ pqr} \\
& bcd & qwe & \\
y=2 & abc & xyz & {asd,\\ pqr} \\
& bcd & qwe & \\
y=3 & abc & xyz & {asd,\\ pqr} \\
& bcd & qwe & \\
y=4 & abc & xyz & {asd,\\ pqr} \\
& bcd & qwe & \\
\end{tblr}
\end{document}
Produced table is similar as before:
Here is a solution with {NiceTabular} of nicematrix.
\documentclass[margin=3mm]{standalone}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{c|c|c|c|}[hlines]
\Block{2-1}{x=1} & abc & xyz & \Block{2-1}{asd, \\ pqr} \\
& bcd & qwe \\
\Block{2-1}{x=2} & abc & xyz & \Block{2-1}{asd, \\ pqr} \\
& bcd & qwe \\
\Block{2-1}{x=3} & abc & xyz & \Block{2-1}{asd, \\ pqr} \\
& bcd & qwe \\
\Block{2-1}{x=4} & abc & xyz & \Block{2-1}{asd, \\ pqr} \\
& bcd & qwe \\
\end{NiceTabular}
\end{document}
You can probably achieve this by nesting tabular-environments - each cell itself could be a tabular-environment on it own, tabular-environments in leftmost-column vertically [t]-aligned, tabular-environments in other columns vertically [c]-aligned:
\documentclass{article}
\usepackage{array}
\begin{document}
\sffamily\selectfont
\begin{tabular}{|@{}c@{}|@{}c@{}|@{}c@{}|@{}c@{}|}%
\hline \begin{tabular}[t]{c}$\mathsf{x=1}$\end{tabular}%
& \begin{tabular}[c]{l@{\hskip4\tabcolsep}}
\rlap{abc}\hphantom{\vbox{\hbox{abc}\hbox{bcd}\hbox{a1b1c1}\hbox{b1c1d1}\hbox{a11b11c11}\hbox{b11c11d11}\hbox{a111b111c111}\hbox{b111c111d111}}}
\\\hline
\rlap{bcd}\hphantom{\vbox{\hbox{abc}\hbox{bcd}\hbox{a1b1c1}\hbox{b1c1d1}\hbox{a11b11c11}\hbox{b11c11d11}\hbox{a111b111c111}\hbox{b111c111d111}}}
\end{tabular}%
& \begin{tabular}[c]{l@{\hskip4\tabcolsep}}
\rlap{xyz}\hphantom{\vbox{\hbox{xyz}\hbox{qwe}\hbox{x1y1z1}\hbox{q1w1e1}\hbox{x11y11z11}\hbox{q11w11e11}\hbox{x111y111z111}\hbox{q111w111e111}}}
\\\hline
\rlap{qwe}\hphantom{\vbox{\hbox{xyz}\hbox{qwe}\hbox{x1y1z1}\hbox{q1w1e1}\hbox{x11y11z11}\hbox{q11w11e11}\hbox{x111y111z111}\hbox{q111w111e111}}}
\end{tabular}%
& \begin{tabular}[c]{r}asd,\\[\arrayrulewidth] pqr\end{tabular}%
\\
\hline \begin{tabular}[t]{c}$\mathsf{x=2}$\end{tabular}%
& \begin{tabular}[c]{l@{\hskip4\tabcolsep}}
\rlap{a1b1c1}\hphantom{\vbox{\hbox{abc}\hbox{bcd}\hbox{a1b1c1}\hbox{b1c1d1}\hbox{a11b11c11}\hbox{b11c11d11}\hbox{a111b111c111}\hbox{b111c111d111}}}
\\\hline
\rlap{b1c1d1}\hphantom{\vbox{\hbox{abc}\hbox{bcd}\hbox{a1b1c1}\hbox{b1c1d1}\hbox{a11b11c11}\hbox{b11c11d11}\hbox{a111b111c111}\hbox{b111c111d111}}}
\end{tabular}%
& \begin{tabular}[c]{l@{\hskip4\tabcolsep}}
\rlap{x1y1z1}\hphantom{\vbox{\hbox{xyz}\hbox{qwe}\hbox{x1y1z1}\hbox{q1w1e1}\hbox{x11y11z11}\hbox{q11w11e11}\hbox{x111y111z111}\hbox{q111w111e111}}}
\\\hline
\rlap{q1w1e1}\hphantom{\vbox{\hbox{xyz}\hbox{qwe}\hbox{x1y1z1}\hbox{q1w1e1}\hbox{x11y11z11}\hbox{q11w11e11}\hbox{x111y111z111}\hbox{q111w111e111}}}
\end{tabular}%
& \begin{tabular}[c]{r}asd,\\[\arrayrulewidth] pqr\end{tabular}%
\\\hline \begin{tabular}[t]{c}$\mathsf{x=3}$\end{tabular}%
& \begin{tabular}[c]{l@{\hskip4\tabcolsep}}
\rlap{a11b11c11}\hphantom{\vbox{\hbox{abc}\hbox{bcd}\hbox{a1b1c1}\hbox{b1c1d1}\hbox{a11b11c11}\hbox{b11c11d11}\hbox{a111b111c111}\hbox{b111c111d111}}}
\\\hline
\rlap{b11c11d11}\hphantom{\vbox{\hbox{abc}\hbox{bcd}\hbox{a1b1c1}\hbox{b1c1d1}\hbox{a11b11c11}\hbox{b11c11d11}\hbox{a111b111c111}\hbox{b111c111d111}}}
\end{tabular}%
& \begin{tabular}[c]{l@{\hskip4\tabcolsep}}
\rlap{x11y11z11}\hphantom{\vbox{\hbox{xyz}\hbox{qwe}\hbox{x1y1z1}\hbox{q1w1e1}\hbox{x11y11z11}\hbox{q11w11e11}\hbox{x111y111z111}\hbox{q111w111e111}}}
\\\hline
\rlap{q11w11e11}\hphantom{\vbox{\hbox{xyz}\hbox{qwe}\hbox{x1y1z1}\hbox{q1w1e1}\hbox{x11y11z11}\hbox{q11w11e11}\hbox{x111y111z111}\hbox{q111w111e111}}}
\end{tabular}%
& \begin{tabular}[c]{r}asd,\\[\arrayrulewidth] pqr\end{tabular}%
\\\hline \begin{tabular}[t]{c}$\mathsf{x=4}$\end{tabular}%
& \begin{tabular}[c]{l@{\hskip4\tabcolsep}}
\rlap{a111b111c111}\hphantom{\vbox{\hbox{abc}\hbox{bcd}\hbox{a1b1c1}\hbox{b1c1d1}\hbox{a11b11c11}\hbox{b11c11d11}\hbox{a111b111c111}\hbox{b111c111d111}}}
\\\hline
\rlap{b111c111d111}\hphantom{\vbox{\hbox{abc}\hbox{bcd}\hbox{a1b1c1}\hbox{b1c1d1}\hbox{a11b11c11}\hbox{b11c11d11}\hbox{a111b111c111}\hbox{b111c111d111}}}
\end{tabular}%
& \begin{tabular}[c]{l@{\hskip4\tabcolsep}}
\rlap{x111y111z111}\hphantom{\vbox{\hbox{xyz}\hbox{qwe}\hbox{x1y1z1}\hbox{q1w1e1}\hbox{x11y11z11}\hbox{q11w11e11}\hbox{x111y111z111}\hbox{q111w111e111}}}
\\\hline
\rlap{q111w111e111}\hphantom{\vbox{\hbox{xyz}\hbox{qwe}\hbox{x1y1z1}\hbox{q1w1e1}\hbox{x11y11z11}\hbox{q11w11e11}\hbox{x111y111z111}\hbox{q111w111e111}}}
\end{tabular}%
& \begin{tabular}[c]{r}asd,\\[\arrayrulewidth] pqr\end{tabular}%
\\
\hline
\end{tabular}
\end{document}
If you decide to specify a width for table-columns, you don't need the combination of \rlap and \hphantom for ensuring equal widths for all tables in one column.






multirowpackage.