我使用 siunitx 和 multirow 包。如图所示,多行文本的一半被剪切。
\documentclass[super,square,compress,sort,num-refs]{wiley-article}
\usepackage{siunitx}
\usepackage[normalem]{ulem}
\usepackage{multirow}
\usepackage{mciteplus}
\usepackage{natbib}
\usepackage{lettrine}
\usepackage{setspace}
\usepackage{float}
\usepackage{booktabs}
\usepackage{marginnote}
\usepackage[T1]{fontenc}
\useunder{\uline}{\ul}{}
\begin{table}[!ht]
\centering
\caption{Not working table}
\footnotesize
\label{tab:Table not working}
\begin{tabular}{cccccc}
{} & Name & \begin{tabular}[c]{@{}c@{}}flow\\ {(}unit{)}\end{tabular} & \begin{tabular}[c]{@{}c@{}}speed\\ {(}unit{)}\end{tabular} & \begin{tabular}[c]{@{}c@{}}time\\ {(}unit{)}\end{tabular} & \begin{tabular}[c]{@{}c@{}}Pressure\\ {(}unit{)}\end{tabular} \\ \hline
{\multirow{2}{*}{Value 1}} & {A} & 80 & 20 & 50 &{\multirow{2}{*}{Value 3}} \\
& {B} & 80 & 20 & 50 & \\
{\multirow{2}{*}{Value 2}} & {C} & 40 & 40 & 50 & {\multirow{2}{*}{Value 4}} \\
& {D} & 40 & 20 & \multicolumn{1}{l}{50} & \\ \hline
\end{tabular}
\end{table}
答案1
我怀疑你在寻找
- 您的文档示例不完整,缺少
\begin{document}
和\end{document}
- 表格代码不包含用于着色行的代码
- 由于我没有使用文档类,所以我使用标准
article
。解决方案必须wiley-article
与 - 当行被着色时,您必须移动
multirow
到多行单元格的末尾:\multirow{-2}{*}{Value 1}
看看以下 mwe 是否会生成与上面类似的图像:
\documentclass[super,square,compress,sort,num-refs]{wiley-article}
\usepackage{siunitx}
\usepackage[normalem]{ulem}
\usepackage{mciteplus}
\usepackage{natbib}
\usepackage{lettrine}
\usepackage{setspace}
\usepackage{float}
\usepackage{booktabs, multirow}
\usepackage{marginnote}
\usepackage[T1]{fontenc}
\useunder{\uline}{\ul}{}
\newcommand\MakeCell[1]{\begin{tabular}[b]{@{} c @{}}#1\end{tabular}}
\begin{document}
\begin{table}[!ht]
\centering
\caption{Not working table}
\footnotesize
\label{tab:Table not working}
\begin{tabular}{cc cc cc}
\hline
& Name
& \makecell[b]{flow\\ (unit)}
& \makecell[b]{speed\\ (unit)}
& \makecell[b]{time\\ (unit)}
& \makecell[b]{Pressure\\ (unit)} \\
\hline
& A & 80 & 20 & 50 & \\
\multirow{-2}{*}{Value 1} & B & 80 & 20 & 50 & \multirow{-2}{*}{Value 3} \\
& C & 40 & 40 & 50 & \\
\multirow{-2}{*}{Value 2} & D & 40 & 20 & 50 & \multirow{-2}{*}{Value 4} \\
\hline
\end{tabular}
\end{table}
\end{document}