简体   繁体   中英

Extra space between text of first and second rows in LaTex tabular environment

How to remove the extra space between the text of the first and second rows? Thanks in advance!

\documentclass[jou]{apa7}
\usepackage{siunitx}
\usepackage{textcomp}

\begin{document}
\begin{tabular}{m{13em}m{1cm}m{1cm}m{1cm}m{13em}m{1cm}m{1cm}m{1cm}}  \hline
    & A & B & C & & D & E & F \\ \hline
Model 1: Name of the first model inserted here & & & & Model 2: Name of the second model inserted here & & & & \\ 
\hspace{3mm} Integration strategies & .03 & .10 & .000 & Integration strategies & .34 & .08 & .000 \\
\hspace{3mm} Integration strategies & .12 & .03 & .56 & Integration strategies & .12 & .19 & .404\\

\end{tabular}
\end{document}

在此处输入图像描述

Your table is defined with 9 columns, but in the second row you use 10. You will get an error about this, so you shouldn't even look at what might or might not be a valid pdf.

If the error is fixed, the table will look like this:

\documentclass[jou]{apa7}
\usepackage{siunitx}
\usepackage{textcomp}

\begin{document}
\begin{tabular}{m{13em}m{1cm}m{1cm}m{1cm}m{13em}m{1cm}m{1cm}m{1cm}}  \hline
    & A & B & C & & D & E & F \\ \hline
Model 1: Name of the first model inserted here & & & & Model 2: Name of the second model inserted here & & & \\ 
\hspace{3mm} Integration strategies & .03 & .10 & .000 & Integration strategies & .34 & .08 & .000 \\
\hspace{3mm} Integration strategies & .12 & .03 & .56 & Integration strategies & .12 & .19 & .404\\

\end{tabular}
\end{document}

在此处输入图像描述

Instead of hard-coding the widths of all columns, it might be easier to use the tabularx package (and maybe the booktabs package for better spacing):

\documentclass[jou]{apa7}
\usepackage{siunitx}
\usepackage{textcomp}
\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}
\begin{tabularx}{\linewidth}{XlllXlll}  
\toprule
    & A & B & C & & D & E & F \\ 
\midrule
Model 1: Name of the first model inserted here & & & & Model 2: Name of the second model inserted here & & & \\ 
\quad Integration strategies & .03 & .10 & .000 & Integration strategies & .34 & .08 & .000 \\
\quad Integration strategies & .12 & .03 & .56 & Integration strategies & .12 & .19 & .404\\
\bottomrule
\end{tabularx}
\end{document}

在此处输入图像描述

Normally I would also suggest to use @{}XlllXlll@{} to remove the space in front and after the columns, but for this specific example, this lead to a really bad linebreak

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM