Double vertical line column type in tabular

arrayscolumnshlinetablestabularx

I need a column type with 2 vertical lines but I want the horizontal line to not go trought it.

The result would be like this :

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage{array}

\begin{document}

\begin{tabular}{| p{5cm} | p{0.1cm} | p{5cm} |}
    \cline{1-1} \cline{3-3}
    \lipsum[1][1] & & \lipsum[1][1]  \\
    \cline{1-1} \cline{3-3}
    \lipsum[1][1] & & \lipsum[1][1]  \\
    \cline{1-1} \cline{3-3}
\end{tabular}

\end{document}

enter image description here

But that way, I can't make the space smaller.

So, I've created this columntype :

\newcolumntype{D}{!{\vrule \hspace{0.1cm} \vrule}}

And this is the result :

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage{array}

\newcolumntype{D}{!{\vrule \hspace{0.1cm} \vrule}}

\begin{document}

\begin{tabular}{| p{5cm} D p{5cm} |}
    \hline
    \lipsum[1][1] & \lipsum[1][1]  \\
    \hline
    \lipsum[1][1] & \lipsum[1][1]  \\
    \hline
\end{tabular}

\end{document}

enter image description here

I have no idea how to create this new column type and code the fact that I was the horizontal line to be interruped … And the \cline command is not helping here ..

Thanks for the answers and sorry by advance if this question has been already asked ! 🙂

Best Answer

It's possible to achieve this by a combination of cmidrule with NiceTabular.

\documentclass{article}

\usepackage{lipsum}
\usepackage{nicematrix}
\usepackage{booktabs}

\begin{document}

\begin{NiceTabular}{|p{5cm}||p{5cm}|}
    \cmidrule(r{0.25em}){1-1} \cmidrule{2-2}
    \lipsum[1][1] & \lipsum[1][1]  \\
    \cmidrule(r{0.25em}){1-1} \cmidrule{2-2}
    \lipsum[1][1] & \lipsum[1][1]  \\
    \cmidrule(r{0.25em}){1-1} \cmidrule{2-2}
\end{NiceTabular}

\end{document}

output