答案1
部分考虑到奇数个分组行,这里有一种方法,使用multirow, array, caption
和siunitx
将数字与最后一列的小数点对齐。
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{multirow, array, caption}
\usepackage{siunitx}
\begin{document}
\begin{table}[!htb]
\sisetup{table-format =1.11, table-number-alignment=center}
\centering\setlength\extrarowheight{2pt}
\caption{Title here}$ \begin{array}{|*{3}{c|}>{\color{red}}S|}%
\hline
\multirow{9}{*}{$ \sum_k f(k, \alpha, t) $}
& & t = 0.1 & 0.123456789 \\
\cline{3-4} %
& \alpha= 1 & t = 0.5 & 1.04400440\\
\cline{3-4}%
& & t = 0.9 & 2.71828182845 \\
\cline{2-4}%
& &t = 0.1 & 0.123456789\\ %
\cline{3-4}%
& \alpha=2 & t = 0.5 & 1.04400440\\
\cline{3-4}%
& & t = 0.9 & 2.71828182845 \\
\cline{2-4}%
& &t = 0.1 & \\
\cline{3-4}%
& \alpha=3 & t = 0.5 & \\
\cline{3-4}%
& & t = 0.9 & \\
\hline%
\end{array} $
\end{table}
\end{document}
答案2
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{table}[htb]
\centering
\caption{Title here}
\label{my-label}
\begin{tabular}{|c|c|c|c|}
\hline
\multirow{9}{*}{$\sum_kf(k,\alpha,t)$} & \multirow{3}{*}{$\alpha=1$} & t=0.1 & 0.123456789 \\ \cline{3-4}
& & t=0.5 & 1.04400440 \\ \cline{3-4}
& & t=0.9 & 2.71828182845 \\ \cline{2-4}
& \multirow{3}{*}{$\alpha=2$} & t=0.1 & \\ \cline{3-4}
& & t=0.5 & \\ \cline{3-4}
& & t=0.9 & \\ \cline{2-4}
& \multirow{3}{*}{$\alpha=3$} & t=0.1 & \\ \cline{3-4}
& & t=0.5 & \\ \cline{3-4}
& & t=0.9 & \\ \hline
\end{tabular}
\end{table}
\end{document}
如果您需要更易读的版本,请考虑使用以下booktabs
包:
\documentclass{article}
\usepackage{multirow,booktabs}
\begin{document}
\begin{table}[htb]
\centering
\caption{Title here}
\label{my-label2}
\begin{tabular}{ccl}
\toprule
$\alpha$ & $t$ & $\sum_kf(k,\alpha,t)$ \\ \midrule
1 & 0.1 & 0.123456789 \\
& 0.5 & 1.04400440 \\
& 0.9 & 2.71828182845 \\ \midrule
2 & 0.1 & \\
& 0.5 & \\
& 0.9 & \\ \midrule
3 & 0.1 & \\
& 0.5 & \\
& 0.9 & \\ \bottomrule
\end{tabular}
\end{table}
\end{document}
答案3
我认为第一列中的材料以蓝色显示,最后一列中的材料以红色显示很重要。我还建议您使用环境,array
因为看起来所有内容都应该在数学模式下呈现。
以下解决方案无需任何\multirow
指令即可实现。
\documentclass{article}
\usepackage{array} % for '\extrarowheight' macro
\usepackage{xcolor}% for '\color' macro
\begin{document}
\[
\setlength\extrarowheight{2pt} % provide for a slightly more "open" look
\begin{array}{| >{\color{blue}}c | c | c | >{\color{red}}c |} \hline
& & t=0.1 & 0.123545 \\ \cline{3-4}
& \alpha=1 & t=0.5 & 1.044044 \\ \cline{3-4}
& & t=0.9 & 2.718281 \\ \cline{2-4}
& & t=0.1 & \ldots \\ \cline{3-4}
\sum_k f(k,\alpha,t) & \alpha=2 & t=0.5 & \ldots \\ \cline{3-4}
& & t=0.9 & \ldots \\ \cline{2-4}
& & t=0.1 & \ldots \\ \cline{3-4}
& \alpha=3 & t=0.5 & \ldots \\ \cline{3-4}
& & t=0.9 & \ldots \\ \hline
\end{array}
\]
\end{document}