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}
F. Pantigny
  • 40,250

2 Answers2

3

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}

js bibra
  • 21,280
2

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

Bernard
  • 271,350