简体   繁体   English

乳胶桌中的一条水平线

[英]A horizontal line in a latex table

I want to put a horizontal line between first and second rows in the following table:我想在下表的第一行和第二行之间放置一条水平线:

\begin{table}[ht]
    \centering
    \caption{Multi-row table}
    \label{tab:Mergedrows}
    \vspace{1ex}
        \begin{tabular}{|c|c|}
            \hline
            \multirow{2}{*}{Mergedrows}
            &X\\
            &X \\
            \hline
        \end{tabular}
\end{table}

How to do this?如何做到这一点?

Just like the documentation to multirow shows: by adding a cline :就像multirow文档一样:通过添加一个cline

\documentclass{article}
\usepackage{multirow}

\begin{document}
\begin{table}[ht]
    \centering
    \caption{Multi-row table}
    \label{tab:Mergedrows}
    \vspace{1ex}
        \begin{tabular}{|c|c|}
            \hline
            \multirow{2}{*}{Mergedrows}
            &X\\
            \cline{2-2} % add this
            &X \\
            \hline
        \end{tabular}
\end{table}
\end{document}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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