Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

My code is as below. Last column line is splitted when I leave space between the rows. How can I get a solid vertical line? Please reply

\begin{table}[h!]
        \caption{\textbf{$\alpha=10; U=1; q_u=10; q^{*}=0.3; K_0=0.41; \mu_1=\mu_2=0.5; G_m=0.1$
        }}
        \begin{center}
            \begin{tabular}{|p{4cm}|p{5cm}|p{5cm}|} \hline
                    \hspace{4cm} {\textbf{Applied Pre-stress}} & \textbf{Equivalent Shear Modulus , $G_e$ , considering Confinement effect} &\textbf{Equivalent Shear Modulus , $G_e$ , without considering Confinement effect}\\ \hline
                    0 & 0.318921 & 0.32016 \\ & \\
                    0.2 & 0.932458 & 0.935286\\ & \\
                    0.4 &  1.473396 & 1.476634 \\ & \\
                    0.6 & 1.997815 & 2.003647\\ & \\
                    0.8 & 2.517339 & 2.524832\\ & \\
                    1.0 & 3.033942 & 3.043077 \\ \hline
            \end{tabular}
                    \label{t2}
        \end{center}
\end{table}
share|improve this question
add comment

2 Answers

Don't use line breaks (& \\) in tables.

\documentclass{article}

\def\VSpace{1.0ex}%  Adjust this to what spacing you want
\begin{document}
\begin{table}[h!]
        \caption{\textbf{$\alpha=10; U=1; q_u=10; q^{*}=0.3; K_0=0.41; \mu_1=\mu_2=0.5; G_m=0.1$
        }}
        \begin{center}
            \begin{tabular}{|p{4cm}|p{5cm}|p{5cm}|} \hline
                    \hspace{4cm} {\textbf{Applied Pre-stress}} & \textbf{Equivalent Shear Modulus , $G_e$ , considering Confinement effect} &\textbf{Equivalent Shear Modulus , $G_e$ , without considering Confinement effect}\\ \hline
                    0 & 0.318921 & 0.32016 \\[\VSpace]
                    0.2 & 0.932458 & 0.935286\\[\VSpace]
                    0.4 &  1.473396 & 1.476634 \\[\VSpace]
                    0.6 & 1.997815 & 2.003647\\[\VSpace]
                    0.8 & 2.517339 & 2.524832\\[\VSpace]
                    1.0 & 3.033942 & 3.043077 \\ \hline
            \end{tabular}
                    \label{t2}
        \end{center}
\end{table}
\end{document}
share|improve this answer
add comment

If you want more space between the lines then use the optional argument

\documentclass{article}
\usepackage{tabularx}
\begin{document}

\begin{table}[htb!]
\caption{\textbf{$\alpha=10; U=1; q_u=10; q^{*}=0.3; K_0=0.41; \mu_1=\mu_2=0.5; G_m=0.1$}}
                    \label{t2}
\centering
\begin{tabularx}{\linewidth}{|X|X|X|} \hline
\hspace{4cm} {\textbf{Applied Pre-stress}} & \textbf{Equivalent Shear Modulus , $G_e$ , considering Confinement effect} &\textbf{Equivalent Shear Modulus , $G_e$ , without considering Confinement effect}\\ \hline
                    0 & 0.318921 & 0.32016 \\[10pt] 
                    0.2 & 0.932458 & 0.935286\\[10pt] 
                    0.4 &  1.473396 & 1.476634 \\[10pt] 
                    0.6 & 1.997815 & 2.003647\\[10pt] 
                    0.8 & 2.517339 & 2.524832\\[10pt] 
                    1.0 & 3.033942 & 3.043077 \\ \hline
\end{tabularx}
\end{table}

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.