0

I'm trying to create a table where part of the table is highlighted with thick lines surrounding it. enter image description here

Using tabular and variants of \cline, I can create partial horizontal lines. However, I have not found any method for creating partial vertical lines. Any suggestions?

1

Inspired by my answer to a previous question:

enter image description here

\documentclass{article}
\usepackage{array}

\newlength{\defaultarrayrulewidth}
\newcommand{\Cline}[2]{%
  \noalign{\global\setlength{\defaultarrayrulewidth}{\arrayrulewidth}}%
  \noalign{\global\setlength{\arrayrulewidth}{#1}}\cline{#2}%
  \noalign{\global\setlength{\arrayrulewidth}{\defaultarrayrulewidth}}}


\begin{document}

\begin{tabular}{|c|c|c|c|c|}
\hline
A1 & A2 & A3& A4&  A5 \\
\cline{1-1} \Cline{1pt}{2-3} \cline{4-5}
 B1 & \multicolumn{1}{!{\vrule width 1pt}c|}{B2}& \multicolumn{1}{c!{\vrule width 1pt}}{B3}&  B4 & B5 \\
\hline
C1 & \multicolumn{1}{!{\vrule width 1pt}c|}{C2} & \multicolumn{1}{c!{\vrule width 1pt}}{C3}&  C4 & C5\\
\cline{1-1} \Cline{1pt}{2-3} \cline{4-5}
D1 & D2 & D3& D4&  D5\\
\hline
\end{tabular}

\end{document}

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.