# Remove vertical lines in the table unsuccessfully

I have created this Table:

via the LaTex source code:

\begin{document}
\begin{table}[!h]
\begin{tabular}{|c ||c| c| c| c|}
\hline
$(d+1)$D \; & \;  $Z$  & \; $UZ1$ & \; $UZ2$ & \; $U$\\
\; & \;   & \;       \;   & \;       \;   & \;   \\ \hline
$d=0$         \; & \; 0   & \; 0      \;   & \; $Z$       \;   & \;    \\
\; & \;   & \;       \;   & \;  $n \in Z$: $n \int A$     \;     & \;  \\   \hline
$d=1$    \; & \; $Z_2$    & \;       \;   & \;       \;   & \;  \\
\; & \;  $S_1=\int x_1{}^2$  & \;       \;   & \;    \;   & \;   \\   \cline{2-5}
\; & \; G  & \;     G  \;   & \; G   \;   & \;  G \\   \hline
$d=2$       \; & \;   & \;       \;   & \;     \;   & \;   \\
\; & \;   & \;       \;   & \;    \;   & \;   \\   \hline
\end{tabular}
\caption{}
\end{table}

\end{document}

Question: What I wish is that to join all the G, G, G, G in the d=1 section into one row. That is I wish to remove the three vertical lines (vline) among four G. How to do that?

I try to use this method from the previous post, but it does not work well. The function I tried is

\multicolumn{4}{ l|}{G}

which does not work. I use revtex4, which should not matter too much.

-
While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. –  Peter Grill May 23 at 23:21
please always post complete documents not fragments, but you want \multicolumn{1}{c}{G} for a G in a cell without vertical lines –  David Carlisle May 23 at 23:21
@ David, That is true, somehow I add this \; which makes trouble to me. With \; then \; \multicolumn{4}{l|}{G G G G} cannot compile successfully. But remove \;, it works. –  Idear May 23 at 23:42
@DavidCarlisle: Yeah, I just covered both cases. But deleted the comment one I saw you had provided the solution. So perhaps we should remove this comment and yours above {1} not {4} as my comment that you are responding to is no longer there. –  Peter Grill May 23 at 23:46
\multicolumn has to be the complete cell if you did want \; it would be \multicolumn{1}{c}{\; G\:} not with the \; outside, but better without them at all. –  David Carlisle May 23 at 23:48

This works:

\documentclass{revtex4}
\usepackage{amsfonts}
\newcommand\Z{\mathbb{Z}}
\begin{document}
\begin{table}[!h]
\begin{tabular}{|c ||c| c| c| c|}
\hline
$(d+1) D$  &   $Z$  &  $UZ1$ &  $UZ2$ &  $U$\\
&   &          &          &   \\ \hline
$d=0$          &  0   &  0        & $\Z$        &     \\
&    &           &   $n \in \Z$: $n \int A$          &   \\   \hline
$d=1$     &  $\Z_2$    &           &           &   \\
&   $S_1=\int x_1{}^2$  &           &        &    \\   \cline{2-5}
&  \multicolumn{4}{l|}{G        G       G         G} \\   \hline
$d=2$        &    &           &         &    \\
&    &           &        &    \\   \hline
\end{tabular}
\caption{}
\end{table}
\end{document}

Instead of using all those \;, if you want some more space, change \tabcolsep like

\setlength{\tabcolsep}{4pt}

and put it just after \begin{table} so that it is made local.

\begin{table}[!h]
\setlength{\tabcolsep}{4pt}
-
If not give full MWE and more details. –  Harish Kumar May 23 at 23:29
That is true, somehow I add this \; which makes trouble to me. With \; then \; \multicolumn{4}{l|}{G G G G} cannot compile successfully. But remove \;, it works! Thanks! +1. –  Idear May 23 at 23:43

\documentclass{article}
\usepackage{array}
\setlength\extrarowheight{2pt}
\newcommand\Z{Z}
\begin{document}

\begin{table}[htbp]%never h on its own
\centering
\begin{tabular}{|c ||c| c| c| c|}
\hline
$(d+1)$D  &   $Z$  &  $UZ1$ &  $UZ2$ &  $U$\\
&    &           &           &    \\ \hline
$d=0$   &  0   &  0         &  $\Z$          &     \\
&    &           &   $n \in \Z$: $n \int A$          &   \\   \hline
$d=1$     &  $\Z_2$    &           &        &   \\
&   $S_1=\int x_1{}^2$  &           &        &    \\   \cline{2-5}
&  \multicolumn{1}{c}{G}  & \multicolumn{1}{c}{G}&  \multicolumn{1}{c}{G}      & G \\   \hline
$d=2$        &    &           &         &    \\
&    &           &        &    \\   \hline
\end{tabular}
\caption{zzz}
\end{table}
\end{document}
-
thanks so much. it works. –  Idear May 23 at 23:43