【问题标题】:Merging cells in LaTeX tables合并 LaTeX 表格中的单元格
【发布时间】:2011-01-14 12:32:33
【问题描述】:

我有一个非常简单的表格:

\begin{table}[t]
\begin{tabular}{|c||c|c|c|}
\hline
\multirow{2}{*}{Implementation}         & Test 1  & Test2  &  Test3    \\\hline
                                        & \multicolumn{3}{|c|}{results}   \\\hline\hline
\end{tabular}
\end{table}

它几乎“完美”地工作,我唯一的问题是 hline 仍然通过我合并的前两个单元格。 基本上是这样的

"-------------------------------------------------"
"|                | Test 1 | Test 2 | Test 3 |"
" ----Implementation-------------------------------"
"|                |     results      |"  
"-------------------------------------------------"

但是,它应该是这样的:

"-------------------------------------------------" 
"|               | Test 1 | Test 2 | Test 3 |"
"   Implementation    ---------------------------"
"|               |      results     |"   
"-------------------------------------------------"

有人知道如何去掉第一列中的行吗?

谢谢

【问题讨论】:

    标签: latex pdflatex


    【解决方案1】:

    您想要的命令是 \cline{i-j},它允许您在某些列上绘制行分隔符。详情请见http://www.giss.nasa.gov/tools/latex/ltx-214.html

    特别是,您需要使用 \cline{2-4} 在您提到的列之间绘制一条水平线。这是您的代码,其中有一个更改:

    \begin{table}[t]
    \begin{tabular}{|c||c|c|c|}
    \hline
    \multirow{2}{*}{Implementation}         & Test 1  & Test2  &  Test3    \\\cline{2-4}
                                            & \multicolumn{3}{|c|}{results}   \\\hline\hline
    \end{tabular}
    \end{table}
    

    【讨论】:

      【解决方案2】:

      好吧,解决您的问题,我会注意到许多权威人士建议尽量减少表格中的内部墨水量(即在普通行之间放弃\hlines),并使用某事线the last figure here

      如果您不受某些严格定义的样式指南的限制,这将是我的解决方案。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-03-21
        • 2020-09-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多