1

In fact, I have tried to put these tables side by side, I have already checked some methods in tex.stackexchange but they display two table with one caption. I want both table each one with its appropriate caption here is the code:

\documentclass[10pt]{elsarticle}
\usepackage{lineno}
\modulolinenumbers[5]
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{amssymb,amsmath,nccmath}
\usepackage{cclicenses}
\usepackage{makecell}
\usepackage{lscape,array}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} 
\usepackage[thin, , thinc]{esdiff}
\usepackage{subcaption}
\usepackage{caption}
\usepackage{framed}  
\usepackage[font=small,skip=0pt]{caption}
\begin{document}
\begin{table}[!ht]

\centering
\caption{The parameters 1}
\begin{tabular}{ c c } 
\toprule
\makecell{ parameters}  &  value \\   
\midrule
Rated value &  3.5\\
time & 50 s     \\
value 1 & 100    \\
value 2 & 200  \\
value 3 & 300  \\
value 4 & 400 \\
value 5 & 500  \\
value 6 & 600 \\
VALUE 7 & 700 \\

\bottomrule
\end{tabular}
\vspace{0.5\baselineskip}\vspace{-\parskip}
\label{tab:The parameters}
\end{table}
\begin{table}[!ht]
\centering
\caption{The parameters 2}
\begin{tabular}{ c c } 
\toprule
\makecell{ parameters 2}  &  Value \\   
\midrule
time  &  0.2 s\\
value 8 & 800     \\
value 9 & 900    \\
value 10 & 1000  \\
\bottomrule
\end{tabular}
\vspace{0.5\baselineskip}\vspace{-\parskip}
\label{tab:The parameters 2 }
\end{table}
\end{document}
  • 1
    In fact I want both tables with their own captions – kerdouj kardouj Aug 3 '18 at 11:39
  • My bad!! I am sorry. Could you upload a MWE which is compilable --> this only throws errors when I try to compile. – Raaja Aug 3 '18 at 11:40
  • It's okay now you can check the new code – kerdouj kardouj Aug 3 '18 at 11:45
  • your code is not minimal. also you not say, how you imagine to be vertical aligned both tables ... – Zarko Aug 3 '18 at 12:07
1

I hope this helps. This is done using minipage environment`

\documentclass[10pt]{elsarticle}
\usepackage{lineno}
\modulolinenumbers[5]
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{amssymb,amsmath,nccmath}
\usepackage{cclicenses}
\usepackage{makecell}
\usepackage{lscape,array}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} 
\usepackage[thin, , thinc]{esdiff}
\usepackage{subcaption}
\usepackage{caption}
\usepackage{framed}  
\usepackage[font=small,skip=0pt]{caption}
\begin{document}\begin{table}[!htb]
\begin{minipage}{.5\linewidth}
    \centering

    \caption{First Table}
    \label{tab:first_table}

    \medskip

\begin{tabular}{ c c } 
\toprule
\makecell{ parameters}  &  value \\   
\midrule
Rated value &  1.5MW\\
time & 50 s     \\
value 1 & 100    \\
value 2 & 200  \\
value 3 & 300  \\
value 4 & 400 \\
value 5 & 500  \\
value 6 & 600 \\
VALUE 7 & 700 \\
\bottomrule
\end{tabular}
\end{minipage}\hfill
\begin{minipage}{.5\linewidth}
    \centering

    \caption{Second Table}
    \label{tab:second_table}

    \medskip

\begin{tabular}{ c c } 
    \toprule
    \makecell{ parameters 2}  &  Value \\   
    \midrule
    time  &  0.2 s\\
    value 8 & 800     \\
    value 9 & 900    \\
    value 10 & 1000  \\
    \bottomrule
\end{tabular}
\end{minipage}
\end{table}
\end{document}

enter image description here

  • @kerdoujkardouj you are welcome! – Raaja Aug 3 '18 at 12:01
2

like this?

enter image description here

with use of two minipage environments:

\documentclass[a4paper,twocolumn]{article}
\usepackage[font=small,skip=0pt]{caption}
\usepackage{booktabs}

\begin{document}
    \begin{table}[!ht]
    \centering
\begin{minipage}[t]{0.48\linewidth}\centering
\caption{The parameters 1}
\begin{tabular}{ c c }
\toprule
parameters  &  value \\
\midrule
Rated value &  1.5MW\\
time & 50 s     \\
value 1 & 100    \\
value 2 & 200  \\
value 3 & 300  \\
value 4 & 400 \\
value 5 & 500  \\
value 6 & 600 \\
VALUE 7 & 700 \\
\bottomrule
\end{tabular}
\end{minipage}\hfill%
\begin{minipage}[t]{0.48\linewidth}\centering
\caption{The parameters 2}
\label{tab:The parameters 2 }
\begin{tabular}{ c c }
\toprule
parameters 2    &  Value \\
\midrule
time            &  0.2 s\\
value 8         & 800     \\
value 9         & 900    \\
value 10        & 1000  \\
\bottomrule
\end{tabular}
\end{minipage}
\end{table}
\end{document}

note: from your mwe i remove all in my solution not used packages.

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.