1

There is a related question: How can I draw a horizontal line spanning only some of the table cells?, and I would like to do it for double lines.

How can I fix my code to draw double lines only for some of the table cells?

Issue

There is a command to set a single line, which is \cline{2-3}, and \hline \hline works to draw double lines for entire table.

It cannot work for set the interval for \hline{2-3}, and \hline \hline cannot set a specific interval.

Code

\begin{tabular}{|c|cc|}\hline
\multirow{4}{*}{Foo} & 1 & 2 \\
    & 1 & 2 \\\hline{2-3}\hline{2-3}
    & 1 & 2 \\
    & 1 & 2 \\\hline
\multirow{4}{*}{Bar} & 1 & 2 \\
    & 1 & 2 \\\cline{2-3}
    & 1 & 2 \\
    & 1 & 2 \\\hline
\end{tabular}
1
4

enter image description here

\documentclass{standalone}
\usepackage{nicematrix}

\usepackage{multirow}


\begin{document}
    \begin{NiceTabular}{|c|cc|}
        

        \Block{4-1}     {Foo}   & 1 & 2 \\
                                & 1 & 2 \\ \Hline\Hline
                                & 1 & 2 \\
                                & 1 & 2 \\  \Hline
        \multirow{4}{*}{Bar}    & 1 & 2 \\
                                & 1 & 2 \\  \cline{2-3}
                                & 1 & 2 \\
                                & 1 & 2\\   \hline

\end{NiceTabular}

\end{document}
3

Quite easy with hhline:

\documentclass{article}
\usepackage{multirow}
\usepackage{hhline}

\begin{document}

\begin{tabular}{|c|cc|}\hline
\multirow{4}{*}{Foo} & 1 & 2 \\
    & 1 & 2 \\ \hhline{|~|==|}
    & 1 & 2 \\
    & 1 & 2 \\\hline
\multirow{4}{*}{Bar} & 1 & 2 \\
    & 1 & 2 \\ \hhline{|~|==|}
    & 1 & 2 \\
    & 1 & 2 \\\hline
\end{tabular}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.