多行命令不会在表格环境中关闭整个单元格

多行命令不会在表格环境中关闭整个单元格

我想使用命令制作一个表格\multirow,但是在编译时,最后一条水平线不会关闭单元格中的所有文本,单词 Early-time 不适合单元格,请帮忙吗?

\begin{table}[H]
\begin{center}
\caption{Classification of singularities for the case of late-time}
\begin{tabular}{| m{1.4cm} |  m{1.7cm}|m{1.7cm} | m{2cm}  | }
\hline\multirow{1}{1cm}[0cm]{\centering\textbf{Solution}}  & \multirow{1}{1.7cm}[0cm]{\centering\textbf{Late-Time}} & 
\multirow{1}{1.7cm}[0cm]{\centering\textbf{Early-Time}} &
\multirow{1}{1.7cm}[0cm]{\centering\textbf{Condition}}\\ 
\hline
\end{tabular}
    \label{tabla2}
\end{center}
\end{table}

答案1

你可以给新的 LaTeX3 包tabularray尝试一下:

\documentclass{article}

\usepackage{float}
\usepackage{tabularray}

\begin{document}

\begin{table}[H]
  \centering
  \caption{Classification of singularities for the case of late-time}
  \label{tabla2}
  \begin{tblr}{
    colspec = {|Q[m,c,1.4cm]|Q[m,c,1.7cm]|Q[m,c,1.7cm]|Q[m,c,2cm]|},
    row{1} = {font=\bfseries},
  }
    \hline
      Solution & Late-Time & Early-Time & Condition \\ 
    \hline
  \end{tblr}
\end{table}

\end{document} 

在此处输入图片描述

答案2

在此处输入图片描述

\documentclass[a4paper,12pt]{article}
\usepackage[]{multirow,array,booktabs,makecell}
\begin{document}
\begin{table}[htbp]
\centering
\caption{Classification of singularities for the case of late-time}
\begin{tabular}{| m{1.7cm} |  m{1.7cm}|m{1.7cm} | m{2cm}  |}
\hline
{\multirow{1.6}{*}{\textbf{Solution}}}  
    &{\textbf{\makecell[c]{Late-\\Time}}} 
        &{\textbf{\makecell[c]{Early-\\Time}}} 
            &{\multirow{1.6}{*}{\textbf{Condition}}}\\ 
\hline
\end{tabular}
    \label{tabla2}
\end{table}

{\ttfamily OR -- with booktabs package and no verticals}

\begin{table}[htbp]
\centering
\caption{Classification of singularities for the case of late-time}
\begin{tabular}{ m{1.7cm}   m{1.7cm} m{1.7cm}  m{2cm}  }
\toprule
{\multirow{1.6}{*}{\textbf{Solution}}}  
    &{\textbf{\makecell[c]{Late-\\Time}}} 
        &{\textbf{\makecell[c]{Early-\\Time}}} 
            &{\multirow{1.6}{*}{\textbf{Condition}}}\\ 
\bottomrule
\end{tabular}
    \label{tabla2}
\end{table}

\end{document}

答案3

与。{NiceTabular}nicematrix

\documentclass{article}

\usepackage{float}
\usepackage{nicematrix}

\begin{document}

\begin{table}[H]
  \centering
  \caption{Classification of singularities for the case of late-time}
  \label{tabla2}
  \begin{NiceTabular}{m[c]{14mm}m[c]{17mm}m[c]{17mm}m[c]{2cm}}[hvlines]
    \RowStyle{\bfseries}
    Solution & Late-Time & Early-Time & Condition \\ 
  \end{NiceTabular}
\end{table}

\end{document} 

上述代码的输出

相关内容