0

I would like to create a table with different \vline and \hline width. But, when I use \cline in this table it draws wrong lines in places, where \setlength used in header of tabular. How can I fix it?

\begin{table}
    \centering
    \caption {text} \label{tab:lb3}
    \begin{tabular}
        {@{\setlength{\arrayrulewidth}{0.2em}\vline~}c|c|c|c@{~\setlength{\arrayrulewidth}{0.2em}\vline~}c|c|c@{~\setlength{\arrayrulewidth}{0.2em}\vline~}c|c|c@{~\setlength{\arrayrulewidth}{0.2em}\vline~}c|c|c@{~\setlength{\arrayrulewidth}{0.2em}\vline}} 
        \specialrule{0.2em}{0em}{0em} 
        1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\

        \specialrule{0.2em}{0em}{0em} 
        0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & \multicolumn{3}{c@{~\setlength{\arrayrulewidth}{0.2em}\vline}}{\multirow{3}*{A}} \\
        \cline {1-10}
        0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & \multicolumn{3}{c@{~\setlength{\arrayrulewidth}{0.2em}\vline}}{} \\
        \cline{1-9}
        0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & \multicolumn{3}{c@{~\setlength{\arrayrulewidth}{0.2em}\vline}}{} \\
        \specialrule{0.2em}{0em}{0em}
    \end{tabular}
\end{table}

enter image description here

0

The problem comes from your definition of the thick vertical lines. Here is a correct (and shorter) code:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{multirow, array, caption}
\usepackage{booktabs}

\begin{document}

\begin{table}
\centering
\caption {text} \label{tab:lb3}
\begin{tabular}
    {!{\vrule width 0.2em}c|*4{c|c|c|c!{\vrule width 0.2em}}}
    \specialrule{0.2em}{0em}{0em}
    1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
    \specialrule{0.2em}{0em}{0em}
    0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & \multicolumn{3}{c@{~\setlength{\arrayrulewidth}{0.2em}\vline}}{\multirow{3}*{A}} \\
    \cline {1-10}
    0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & \multicolumn{3}{c@{~\setlength{\arrayrulewidth}{0.2em}\vline}}{} \\
    \cline{1-9}
    0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & \multicolumn{3}{c@{~\setlength{\arrayrulewidth}{0.2em}\vline}}{} \\
    \specialrule{0.2em}{0em}{0em}
\end{tabular}
\end{table}

\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.