拆分多列表格

拆分多列表格

我有一张这样的桌子;

\documentclass{article}
\documentclass[a4paper,onesided,12pt]{report}
\usepackage{array,longtable}
\renewcommand*{\arraystretch}{1.5}

\begin{document}
    \begin{center}
\begin{table}[H]
\caption{Çınar's emergent codes and corresponding themes}
\begin{tabular}{|m{9cm}|m{5cm}| }
\hline\multicolumn{1}{|c|}{RELEVANT CODES} & \multicolumn{1}{|c|}{THEME} \\ 
\hline
Graph representation (false assumption) & \\ 
Graph completion & \multirow{1}{*}{Interpretation of    } \\ 
Determining slope & \multirow{1}{*}{graph} \\
Determining values for horizontal and vertical axes & \\
\hline
Writing problem situation & \multirow{1}{*}{Making sense of model}  \\ 
Solve conflicts on variable- graph interaction by a model& \multirow{1}{*}{representation} \\ 
Writing reasonable real world situation & \\ 
\hline
IV $\rightarrow$ time, DV $\rightarrow$ velocity & \\ IV $\rightarrow$ time, DV $\rightarrow$ location & \\ 
IV $\rightarrow$ undetermined, DV $\rightarrow$ location & \multirow{3}{*}{Searching for} \\
IV $\rightarrow$ decide to change IV except "time"& \multirow{2}{*}{variable} \\
IV $\rightarrow$ temperature, DV $\rightarrow$ temperature & \\
IV $\rightarrow$ time, DV $\rightarrow$ location & \\
IV $\rightarrow$ time, DV $\rightarrow$ subjects completed during summer school & \\ \hline
IV $\rightarrow$ location, DV $\rightarrow$ time and looking their interaction & \multirow{3}{*}{Alignment of } \\ 
Manipulation of graph properties to fit graph to determined variables & \multirow{2}{*}{variable-graph }   \\ 
Finding conflict when matching variables on graph & \\ \hline

Converting graph to table & \multirow{1}{*}{Converting graph} \multirow{1}{*}{to table} \\
\hline
\end{tabular}
\end{table}
\end{center}      
\end{document}

我需要将它们分成两部分,因为表包含多行并且它们不适合放在一页中。

答案1

在以下示例中,我使用了环境longtable,以便如果表格太长而无法放在一页上,则可以将其拆分到多页上。我还确保表格的宽度不超过文本宽度。因此,我计算了第二列相对于当前文本宽度的宽度。此外,我还更正了用法,\multirow以便垂直对齐第二列中的文本与第一列中的相应条目。最后,我删除了所有垂直线,并用包中的规则替换了水平线booktabs。(为了使表格太长而无法放在一页上,我重复了一些内容)

\documentclass[a4paper,12pt]{report}

\usepackage[utf8x]{inputenc} 
\usepackage{longtable}
\usepackage{multirow}
\usepackage{array}

\usepackage{calc}
\usepackage{booktabs}

\newlength{\mycolumnwidth}
\setlength{\mycolumnwidth}{\textwidth-9cm-4\tabcolsep}

\begin{document}

\begin{longtable}{m{9cm}m{\mycolumnwidth} }
\caption{Chris's emergent codes and corresponding themes}\\
\toprule
 RELEVANT CODES &   THEME \\
\endfirsthead 
\caption{Chris's emergent codes and corresponding themes (continued)}\\
\toprule
 RELEVANT CODES &   THEME \\
\endhead 

\midrule
Graph representation (false assumption) & \multirow{4}{\mycolumnwidth}{Interpretation of graph}\\ 
Graph completion &  \\ 
Determining slope & \\
Determining values for horizontal and vertical axes & \\

\midrule

Writing problem situation & \multirow{4}{\mycolumnwidth}{Making sense of model representation}  \\ 
Solve conflicts on variable- graph interaction by a model&  \\ 
Writing reasonable real world situation & \\ 

\midrule

IV $\rightarrow$ time, DV $\rightarrow$ velocity & \multirow{8}{\mycolumnwidth}{Searching for variable}\\ IV $\rightarrow$ time, DV $\rightarrow$ location & \\ 
IV $\rightarrow$ undetermined, DV $\rightarrow$ location &  \\
IV $\rightarrow$ decide to change IV except "time"& \\
IV $\rightarrow$ temperature, DV $\rightarrow$ temperature & \\
IV $\rightarrow$ time, DV $\rightarrow$ location & \\
IV $\rightarrow$ time, DV $\rightarrow$ subjects completed during summer school & \\ 

\midrule

IV $\rightarrow$ location, DV $\rightarrow$ time and looking their interaction & \multirow{5}{\mycolumnwidth}{Alignment of variable-graph} \\ 
Manipulation of graph properties to fit graph to determined variables &   \\ 
Finding conflict when matching variables on graph & \\ 
\midrule

Converting graph to table & Converting graph to table \\

\midrule

Converting graph to model & Converting graph to model \\

\midrule

Interpreting the number on the table &  \multirow{4}{\mycolumnwidth}{Alignment of table and variables} \\ 
Looking for correlation between x and y values& \\ 
Looking for variable that gives "y" value & \\
IV $\rightarrow$ time, DV $\rightarrow$ location confusion  & \\ 

\midrule
%%%%%%%%%%%%%%%%%%%%%%%%
Converting graph to table & Converting graph to table \\

\midrule

Converting graph to model & Converting graph to model \\

\midrule

Interpreting the number on the table &  \multirow{4}{\mycolumnwidth}{Alignment of table and variables} \\ 
Looking for correlation between x and y values& \\ 
Looking for variable that gives "y" value & \\
IV $\rightarrow$ time, DV $\rightarrow$ location confusion  & \\ 
\bottomrule

\end{longtable}


\end{document}

在此处输入图片描述

相关内容