所有表格单元格都需要有两行

所有表格单元格都需要有两行

我通过搜索找到了这个答案:https://tex.stackexchange.com/a/19678/53832

有没有办法让表格中的所有单元格都像这样工作?如果这有任何区别的话,表格中的一些单元格是多行单元格。

平均能量损失

\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage{multirow}
\begin{document}
\begin{table}[ht]
\begin{tabular}{c|c|c|c}
\hline
\multirow{8}{*}{\begin{tabular}[x]{@{}c@{}}This is first line\\This is second line\end{tabular}} & \multirow{4}{*}{\begin{tabular}[x]{@{}c@{}}This is first line\\This is second line\end{tabular}} & \multirow{2}{*}{\begin{tabular}[x]{@{}c@{}}This is first line\\This is second line\end{tabular}} & \begin{tabular}[x]{@{}c@{}}This is first line\\This is second line\end{tabular} \\ [30pt] \cline{4-4}

& & & This cell should have also two lines \\ [30pt] \cline{3-4}

& & \multirow{2}{*}{This cell should have also two lines} & This cell should have also two lines \\ [30pt] \cline{4-4}

& & & \begin{tabular}[x]{@{}c@{}}This is first line\\This is second line\end{tabular} \\ [30pt] \cline{2-4}

& This cell should have also two lines & \multirow{2}{*}{\begin{tabular}[x]{@{}c@{}}This is first line\\This is second line\end{tabular}} & This cell should have also two lines \\ [30pt] \cline{4-4}

& & & This cell should have also two lines \\ [30pt]
\hline
\end{tabular}
\end{table}
\end{document}

相关内容