我正在尝试正确显示我的表格,但我不知道为什么它不起作用:
有人能帮帮我吗?这是图片的代码:
\documentclass[a4paper,12pt,twoside]{book}
\usepackage[bottom=25mm,top=25mm, left=30mm, right=25mm]{geometry}
\usepackage[utf8x]{inputenc}
\usepackage[spanish, es-tabla, es-noshorthands, es-nosectiondot]{babel}
\usepackage{multirow}% http://ctan.org/pkg/multirow
\usepackage{hhline}% http://ctan.org/pkg/hhline
\begin{document}
\begin{table}[ph]
\centering
\begin{tabular}{|c|c|c|c|}
\hline
\multicolumn{4}{ |c| }{Blah} \\
\hline
\multirow{1}{*}{C1F1} & C2F1 & C3F1 & C4F1\\ \hline
\multirow{2}{*}{C1F2} & C2F2 \\& C2F2 &\multirow{2}{*}{C3F2} & \multirow{2}{*}{C4F2}\\ \hline
\multirow{1}{*}{C1F3} & C2F3 & C3F3 & C4F3 \\ \hline
\multirow{2}{*}{C1F4} & C2F4 \\& C2F4 &\multirow{2}{*}{C3F4} & \multirow{2}{*}{C4F4}\\ \hline
\end{tabular}
\caption{blablabla}
\label{blabla}
\end{table}
\end{document}
答案1
以下代码应该可以解决您的问题。我将 \multirow 向上移动一行并创建了多行展开的空单元格。我还删除了 \multirow{1} 并稍微整理了一下表格。
C1F1 & C2F1 & C3F1 & C4F1 \\ \hline
\multirow{2}{*}{C1F2} & C2F2 & \multirow{2}{*}{C3F2} & \multirow{2}{*}{C4F2} \\
& C2F2 & & \\ \hline
C1F3 & C2F3 & C3F3 & C4F3 \\ \hline
\multirow{2}{*}{C1F4} & C2F4 & \multirow{2}{*}{C3F4} & \multirow{2}{*}{C4F4} \\
& C2F4 & & \\ \hline