这几天给您带来的不便,我深感抱歉。希望这是我的最后一桌。我做了以下事情:
但我想制作这个表格(在Word中编译):
第三个单元格中的顶部单元格不断消失。我的 MWE 如下:
\documentclass[12pt]{article}
\usepackage[margin=3cm]{geometry}
\usepackage[font=scriptsize,
labelfont=bf]{caption}
\usepackage[xcdraw]{xcolor}
\usepackage{tabularray}
\usepackage{pdflscape}
\UseTblrLibrary{siunitx}
\usepackage{lipsum}
\begin{document}
\begin{table}[ht]
\centering
\caption{Contact Angles measured at various positions for three Glass Samples - same batch}
\begin{tblr}{hlines, vlines,
colspec={*{5}{X[c,m]}},
colsep=4pt,
row{1}={rowsep=3ex},
row{2}={rowsep=1ex}}
\SetCell[r=2]{c}{Text is here}
& \SetCell[c=3]{c}{There is text in this box}
& \SetCell[r=2]{c}{Wow, some more text} &\\
&Left &M &Right \\
2 & Centre &S3 &S4 &S5 \\
3 & Right &S3 &S4 &S5 \\
4 & Reference &20 &20 &20 \\
\end{tblr}
\end{table}
\end{document}
我非常感谢你们在这段时间里提供的建议/意见。非常感谢!
答案1
在原文中,&
之前缺失了两个\SetCell[r=2]{c}{Wow, some more text}
。
\documentclass[12pt]{article}
\usepackage[margin=3cm]{geometry}
\usepackage[font=scriptsize,
labelfont=bf]{caption}
\usepackage[xcdraw]{xcolor}
\usepackage{tabularray}
\usepackage{pdflscape}
\UseTblrLibrary{siunitx}
\usepackage{lipsum}
\begin{document}
\begin{table}[ht]
\centering
\caption{Contact Angles measured at various positions for three Glass Samples - same batch}
\begin{tblr}{hlines, vlines,
colspec={*{5}{X[c,m]}},
colsep=4pt,
row{1}={rowsep=3ex},
row{2}={rowsep=1ex}}
\SetCell[r=2]{c}{Text is here}
& \SetCell[c=3]{c}{There is text in this box}
&&& \SetCell[r=2]{c}{Wow, some more text} \\
& Left & Middle & Right \\
2 & Centre & S3 & S4 & S5 \\
3 & Right & S3 & S4 & S5 \\
4 & Reference & 20 & 20 & 20 \\
\end{tblr}
\end{table}
\end{document}