向表添加标签

向表添加标签

在此处输入图片描述

在以下帖子中,我提交了我当前表格的图片以及我正在尝试制作的内容。我无法添加带有标签符号、描述、单位和估计值的行,就像我在所需的表格图中显示的那样

求表

\documentclass{article}
\usepackage{multirow,array}
\setlength{\extrarowheight}{2pt}
\begin{document}
\begin{tabular}{|c|c|c|c|c|}
\hline
\multirow{4}{*}{Parameter} & a & surface area of the hole & cm\textsuperscript{2} & 0\\
\cline{2-5}
& A & cross-sectional area of the hole & cm\textsuperscript{2} & 0\\
\cline{2-5}
& u & velocity of water leaving the hole & cm/s & 0\\
\cline{2-5}
& g & gravitational constant & cm/s\textsuperscript{2} & 0 \\
\hline
\multirow{1}{*}{Initial Conditions} & V(0) & initial volume of water above the hole & cm & 0\\
\cline{2-5}
\hline
\multirow{1}{*}{Variables} & V(t) & volume of water at time t & mL & 0 \\
\cline{2-5}
\hline
\end{tabular}
\end{document}

答案1

\documentclass{article}
\usepackage{multirow,array}
\setlength{\extrarowheight}{2pt}
\begin{document}
\begin{tabular}{|c|c|c|c|c|}
\cline{2-5}
\multicolumn{1}{c|}{} & Symbol & Description & Units & Estimated\\
\hline
\multirow{4}{*}{Parameter} & a & surface area of the hole & cm\textsuperscript{2} & 0\\
\cline{2-5}
& A & cross-sectional area of the hole & cm\textsuperscript{2} & 0\\
\cline{2-5}
& u & velocity of water leaving the hole & cm/s & 0\\
\cline{2-5}
& g & gravitational constant & cm/s\textsuperscript{2} & 0 \\
\hline
Initial Conditions & V(0) & initial volume of water above the hole & cm & 0\\
\hline
Variables & V(t) & volume of water at time t & mL & 0 \\
\hline
\end{tabular}
\end{document}

在此处输入图片描述

答案2

我会按如下方式设计您的表格:

在此处输入图片描述

\documentclass{article}
\usepackage{booktabs, multirow}
\usepackage{siunitx}
\usepackage{amsmath}

\begin{document}
    \begin{tabular}{l>{$}c<{$}llc}
    & \text{Symbol}
            & \hfil Description                   & Units     & Estimated\\
    \midrule
Parameters
    & a     & surface area of the hole                  & \si{m^2}  & 0 \\
    & A     & cross-sectional area of the hole          & \si{m^2}  & 0 \\
    & u     & velocity of water leaving the hole        & \si{cm/s} & 0 \\
    & g     & gravitational constant                    & \si{cm/s} & 0 \\
    \midrule
Initial Conditions
    & V(0)  & initial volume of water above the hole    & \si{cm}   & 0 \\
Variables
    & V(t) & volume of water at time $t$                & \si{mL}   & 0 \\
    \bottomrule
    \end{tabular}
\end{document}

答案3

我将使用它siunitx作为第四列,并将该cellspace包用于行的一些垂直填充。请注意,只 multirow需要一个命令 ID。

\documentclass{article}
\usepackage{array, multirow}
\usepackage{siunitx}
\usepackage{cellspace}
\setlength{\cellspacetoplimit}{5pt}
\setlength{\cellspacebottomlimit}{4pt}
\sisetup{per-mode = fraction}
\begin{document}

\begin{tabular}{|*{5}{Cc|}}
\hline
\multirow{4}{*}[-1.6ex]{Parameter}& a & %
{surface area of the hole} & \si{cm²} & 0 \\
\cline{2-5}
& A & %
{cross-sectional area of the hole} & \si {\cm²} & 0 \\
\cline{2-5}
 & u & {velocity of water leaving the hole} & \si{\cm\per \s} & 0 \\
\cline{2-5}
 & g & %
{gravitational constant} & \si{\cm\per \s\squared} & 0 \\
\hline
Initial Conditions & V(0) & initial volume of water above the hole & \si{cm }& 0 \\
\cline{2-5}
\hline
Variables & V(t) & volume of water at time t &\si{mL} & 0 \\
\cline{2-5}
\hline
\end{tabular}

\end{document} 

在此处输入图片描述

相关内容