0

Can you please help me creating the following table in latex. I would be very grateful if the first column (Percentage of Cumulative probability) appears exactly as in the table. Moreover, Is it possible to make it span the two columns in a paper?

Many thanks

enter image description here

I tried this so far which is not compltelty waht I want to do but this what I could do:

\begin{table*}[ht]

\begin{tabular}{| l | l | c | c | c | c |}

  \hline

  \multicolumn{2}{|l|}{Percentage of Cumulative probability}    & Title & Location Error (m)& Expected Improvement  \\

  \hline

\multirow{2}{*}{50$\%$}&Here\\ &Here & 214 & text\\ 

  \hline

  \multicolumn{2}{|l|}{67$\%$}     & text & text   & text \\

  \hline

    \multicolumn{2}{|l|}{95$\%$}     & text & text   & text \\

  \hline

\end{tabular}

\end{table*}
13
  • 1
    Please show what you tried so far.
    – leandriis
    Commented Apr 3, 2020 at 13:03
  • Some hint: table* instead of table tow make the table span both columns, \multirow for the vertically centered contents of the first and last column and the booktabs package for the horizontal lines. If the text in teh second column is quite long, tabularx might also be useful. For the column headers, \thead from the makecell package might be useful.
    – leandriis
    Commented Apr 3, 2020 at 13:04
  • Please tell us which document class you employ.
    – Mico
    Commented Apr 3, 2020 at 13:24
  • \documentclass[11pt,twocolumn,a4paper]{article}
    – Ali A.
    Commented Apr 3, 2020 at 14:28
  • What did you try already? Please tell us what part of the table is specifically problematic to achieve. A small compilable example that shows what you achieved so far would be extremely helpful.
    – leandriis
    Commented Apr 3, 2020 at 14:30

1 Answer 1

1

I am sill not sure, if I understood your request correctly, but here are two suggestions under the assumption that "Here" in the "title" column actually is some longer text.

enter image description here

\documentclass[twocolumn]{article}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{makecell}
\renewcommand{\theadfont}{\itshape}
\begin{document}


\begin{table*}
  \begin{tabularx}{\textwidth}{lXcc}
    \toprule
    \thead[l]{Percentage of\\ cumulative probability}
      & \thead[l]{Title}
        & \thead{Location error\\ for (metres)}
         & \thead{Expected\\ improvement}\\
    \midrule
    \multirow{2}{*}{50\%}
      & Here 
        & 214 
          & \multirow{2}{*}{No.} \\
      & Here
        & 110 \\
    \midrule
  \end{tabularx}
\end{table*}

\begin{table}
  \begin{tabularx}{\linewidth}{lXcc}
    \toprule
    \thead[l]{Percentage of\\ cumulative\\ probability}
      & \thead[l]{Title}
        & \thead{Location\\ error for\\ (metres)}
         & \thead{Expected\\ improvement}\\
    \midrule
    \multirow{2}{*}{50\%}
      & Here 
        & 214 
          & \multirow{2}{*}{No.} \\
      & Here
        & 110 \\
    \midrule
  \end{tabularx}
\end{table}
\end{document}
3
  • Thank you so much.. :) I t worked perfectly. Can I ask for one more favor please. If want to add vertical lines between the four columns, What should I do?
    – Ali A.
    Commented Apr 3, 2020 at 14:53
  • I wuld not recomment adding vertical lines. They make table look less appealing. If you however wat to add them, replace \toprule, \midrule and \bottomrule with \hlne, remove the booktabs` package from your preamble and add | where you want a vertical line (For example {lXc|c} for a vertical line between the third and last column.)
    – leandriis
    Commented Apr 3, 2020 at 15:02
  • Thank you so much for your kind response. I will take by your recommendation, though.. :)
    – Ali A.
    Commented Apr 3, 2020 at 15:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .