3

I was just wondering whether there was a simple way to make the borders of a table straight?

My code currently is:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage{mathrsfs} 
\onehalfspacing
\usepackage{algorithmic}
\textheight=23cm
\textwidth=16cm
\topmargin=-1cm
\oddsidemargin=0cm
\parindent=0mm
\pretolerance=2000
\tolerance=3000
\title{}
\author{}
\date{}
\begin{document}


\setlength{\arrayrulewidth}{1mm}
\setlength{\tabcolsep}{18pt}
\renewcommand{\arraystretch}{1.5}

\begin{tabular}{|p{1.5cm}|p{1.5cm}|p{2.5cm}|p{4.5cm}|  }
\hline
\multicolumn{4}{|c|}{T-Test} \\
\hline
  t   & df& Sig. (2-tailed) & 95\% Confidence Interval \\
\hline
 -3.818 &57 & .000& (-11.31082,-3.52834)  \\

\hline
\end{tabular}

\end{table} 

\end{document}

My table currently looks like: enter image description here

Any solutions would be much appreciated?

5

Add \usepackage{array}, it will connect the lines.

enter image description here

1

If for some reason you do not want additional packages, you can correct the tabular manually:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage{mathrsfs} 
\onehalfspacing
\usepackage{algorithmic}
\textheight=23cm
\textwidth=16cm
\topmargin=-1cm
\oddsidemargin=0cm
\parindent=0mm
\pretolerance=2000
\tolerance=3000
\title{}
\author{}
\date{}
\begin{document}


\setlength{\arrayrulewidth}{1mm}
\setlength{\tabcolsep}{18pt}
\renewcommand{\arraystretch}{1.5}

\begin{tabular}{|p{1.5cm}|p{1.5cm}|p{2.5cm}|p{4.5cm}|  }
\hline\noalign{\null\vspace{-1mm}}
\multicolumn{4}{|c|}{T-Test} \\[-1mm]
\hline
 t   & df& Sig. (2-tailed) & 95\% Confidence Interval \\[-1mm]
\hline
$ -3.818$ &57 &$ .000$& $(-11.31082,-3.52834)$  \\[-1mm]
\hline
\end{tabular}



\end{document}

enter image description here

Please observe math mode in the last line of your tabular.

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.