3

I have a simple table:

\begin{table}[htbp]
    \centering
    \begin{tabular}{|c|c|c|}
        \hline
        X & Y & Z \\ \hline
        &   &   \\ \hline 
        &   &   \\ \hline
        &   &   \\ 
        \hline
    \end{tabular}
\end{table}

I would like to remove the border from all cells in the last column Z.

Is this possible by any chance?

  • Use \cline{1-2} instead of \hline and use {|c|c|c} in the column specification of your tabular environment. – jub0bs Apr 7 '13 at 18:52
6

You should remove the last vertical line from the tabular column specification, and use \clines:

enter image description here

\documentclass{article}
\begin{document}
\begin{tabular}{|c|c|c|}
    \hline
    X & Y & Z \\ \hline
    1 &   &   \\ \hline 
    & 2  &   \\ \hline
    &   & 3  \\ 
    \hline
\end{tabular}

\begin{tabular}{|c|c|c}
    \cline{1-2}
    X & Y & Z \\ \cline{1-2}
    1 &   &   \\ \cline{1-2} 
    & 2  &   \\ \cline{1-2}
    &   & 3  \\ 
    \cline{1-2}
\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.