# Removing border from last column

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

## 1 Answer

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

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