5
\documentclass[a4paper, 12pt]{report}

\usepackage{array}
\usepackage{tabularx,booktabs}
\newcolumntype{Y}{>{\centering\arraybackslash}X}

\begin{document}

\noindent
\begin{minipage}{1\linewidth}
\smallskip
\captionof{table}{Comparision of results of non-linear analysis with Newmark Explicit scheme and Average Acceleration method} \label{comparision}
\begin{tabularx}{\textwidth}{ |X|c|c|c|c| }
\cline{2-5}
   \multicolumn{1}{c|}{} 
 & \multicolumn{2}{c|}{For yield displacement of 0.05 m}  
 & \multicolumn{2}{c|}{For yield displacement of 0.025 m}\\
\hline
 Maximum Displacement (m) &  0.099 & 0.099194 & 0.113 & 0.11322 \\
\hline
    Maximum stiffness force (N) & 1.974 & 1.9739 & 0.987 & 0.98675 \\
\hline
    Time of channge of first elastic to plastic state (sec) & 1.92 & 1.92 & 1.84 & 1.84 \\
\hline
    Time of channge of first plastic to elastic state (sec) & 1.98 & 1.98 & 2.02 & 2.02 \\
\hline

\end{tabularx}

\bigskip


\end{minipage}

\end{document}
  • 1
    Unrelated to the alignment question, but what exactly is the difference between the numbers in the second and in the third column? Aparently, column two contains the rounded numbers of column three but currently there is no indicator for this in the table. – leandriis Jun 9 at 8:23
4

I suggest you change the setup of the tabularx structure so that all five columns are of (modified) type X; then make the first column about three times as wide as each the four data columns. See the code below for how this may be achieved.

Since you're loading the booktabs package, I suggest you actually make use of it: Get rid of all vertical rules and the majority of horizontal rules. Finally, I recommend using the \si and \SI macros of the siunitx package to typeset scientific units and associated quantities.

enter image description here

\documentclass[a4paper,12pt]{report}
\usepackage{tabularx,booktabs,ragged2e,caption,siunitx}
% Set up two modified forms of "X" column type:
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}

\begin{document}

\begin{center}  % no need for a 'minipage'
\captionsetup{justification=raggedright}
\captionof{table}{Comparison of results of non-linear analysis with Newmark Explicit scheme and Average Acceleration method} \label{comparision}

\smallskip
\begin{tabularx}{\textwidth}{@{} 
        >{\hsize=2.2\hsize}L
   *{4}{>{\hsize=0.7\hsize}C} @{}} % note: 2.2+4*0.7=5.0
\toprule 
  & \multicolumn{4}{c@{}}{For yield displacement of}\\
\cmidrule(l){2-5}
  & \multicolumn{2}{c}{\SI{0.05}{\meter}}  
  & \multicolumn{2}{c@{}}{\SI{0.025}{\meter}}\\
\cmidrule(lr){2-3} \cmidrule(l){4-5}
 Maximum Displacement (\si{\meter}) &  0.099 & 0.099194 & 0.113 & 0.11322 \\
\addlinespace
Maximum stiffness force (\si\newton) & 1.974 & 1.9739 & 0.987 & 0.98675 \\
\addlinespace
Time of change of first elastic to plastic state~(\si{\second}) & 1.92 & 1.92 & 1.84 & 1.84 \\
\addlinespace
Time of change of first plastic to elastic state~(\si{\second}) & 1.98 & 1.98 & 2.02 & 2.02 \\
\bottomrule
\end{tabularx}
\end{center}

\end{document}
3

You could put "For yield displacement of" in a common header for the last four columns. This way you can drastically decrease the width of thous columns:

\documentclass[a4paper, 12pt]{report}

\usepackage{array}
\usepackage{tabularx,booktabs}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\usepackage{caption}

\begin{document}

\noindent
\begin{minipage}{1\linewidth}
\smallskip
\captionof{table}{Comparision of results of non-linear analysis with Newmark Explicit scheme and Average Acceleration method} \label{comparision}
\begin{tabularx}{\textwidth}{ |X|c|c|c|c| }
\cline{2-5}
\multicolumn{1}{c|}{} & \multicolumn{4}{c|}{For yield displacement of}\\
\cline{2-5}
   \multicolumn{1}{c|}{} 
 & \multicolumn{2}{c|}{0.05 m}  
 & \multicolumn{2}{c|}{0.025 m}\\
\hline
 Maximum Displacement (m) &  0.099 & 0.099194 & 0.113 & 0.11322 \\
\hline
    Maximum stiffness force (N) & 1.974 & 1.9739 & 0.987 & 0.98675 \\
\hline
    Time of channge of first elastic to plastic state (sec) & 1.92 & 1.92 & 1.84 & 1.84 \\
\hline
    Time of channge of first plastic to elastic state (sec) & 1.98 & 1.98 & 2.02 & 2.02 \\
\hline

\end{tabularx}

\bigskip


\end{minipage}

\end{document}

enter image description here


Personally, I'd prefer a layout with no vertical lines and less horizontal lines:

enter image description here

\documentclass[a4paper, 12pt]{report}

\usepackage{array}
\usepackage{tabularx,booktabs}
\usepackage{caption}

\begin{document}

\captionof{table}{Comparision of results of non-linear analysis with Newmark Explicit scheme and Average Acceleration method} \label{comparision}
\begin{tabularx}{\textwidth}{ Xllll }
\toprule
 & \multicolumn{4}{c}{For yield displacement of}\\
\cmidrule{2-5} 
 & \multicolumn{2}{c}{0.05 m}  
 & \multicolumn{2}{c}{0.025 m}\\
\cmidrule(r){2-3} \cmidrule(l){4-5}
 Maximum Displacement (m) &  0.099 & 0.099194 & 0.113 & 0.11322 \\ \addlinespace
    Maximum stiffness force (N) & 1.974 & 1.9739 & 0.987 & 0.98675 \\ \addlinespace
    Time of change of first elastic to plastic state (sec) & 1.92 & 1.92 & 1.84 & 1.84 \\ \addlinespace
    Time of change of first plastic to elastic state (sec) & 1.98 & 1.98 & 2.02 & 2.02 \\
\bottomrule

\end{tabularx}

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