1

I have this tableenter image description here

I want writ it in latex, Unfortunately I do not know how to do, please help me

Thanks

closed as too broad by ChrisS, Tobi, Svend Tveskæg, Andrew Swann, Mensch Jan 5 '15 at 8:37

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    this is good site wiki/LaTeX/Tables for learning how to make tables in Latex – Nasser Jan 5 '15 at 7:27
  • Your screenshot shows two tables -- which one are you interested in? The header of the second table looks to be seriously messed up: Do you want to reproduce all mistakes? – Mico Jan 5 '15 at 7:30
  • @Dear Mic, I I'm need to both – user69730 Jan 5 '15 at 8:17
  • Please be more specific about what you need to do. Is the data in an external file? Then consider using the pgfplotstable package. If the data is in the main file, have a look at the booktabs package and its documentation. In either case, there are several existing questions here that will help. Look at those and post the LaTeX code you have tried if you can't get the result you want. – Andrew Swann Jan 5 '15 at 8:24
2

Here's some code to get you started. Note that because the first table mostly consists of math material, I suggest using an array environment instead of a tabular environment. I also recommend aligning the numbers in the second table on their decimal markers; one way to do so is to load the siunitx package and use its S column type. The formatting of the captions is handled most easily by loading the caption package.

enter image description here

\documentclass{article}
\usepackage{amsmath,array,booktabs,siunitx,caption}
\captionsetup{labelsep=period,
              justification=raggedright,
              singlelinecheck=false,
              skip=0pt}
\usepackage[margin=1in]{geometry} %choose margins appropriately
\newenvironment{smalltab}%
    {\begin{tabular}[t]{@{}>{\bfseries}c@{}}}%
    {\end{tabular}}
\newcommand\mysim{{\sim}}
\begin{document}
\begin{table}
\caption{Value and distribution of input parameters}
$
\begin{array}{@{} *{7}{c} @{}}
\toprule
\smash[b]{\begin{smalltab} Value \& \\ Distribution \\ \end{smalltab}}
& \multicolumn{6}{c@{}}{\textbf{Parameter}}\\
\cmidrule{2-7}
& n & w_{ij}^c & C_{ij}^c & f_k^q & \mathrm{cap}_{k}^q & t_{kl}^m \\
\midrule
& 30\#8 & p\mysim(20) & U\mysim(1,10) & U\mysim(1000,2000) & U\mysim(100,1000) & U\mysim(10,20)\\
\bottomrule
\end{array}
$
\end{table}

\begin{table}[ht!]
\caption{Comparison metrics for small-sized problems}
\begin{tabular}{@{} >{\bfseries}c *{6}{S[table-format=1.3]} @{}}
\toprule
Problem No. & \multicolumn{3}{c}{\bfseries Quality Metric (QM)}
& \multicolumn{3}{c@{}}{\bfseries Spacing Metric (SM)} \\
\cmidrule(lr){2-4} \cmidrule(l){5-7}
& {PAES} & {NSGA-II} & {MOPSA} & {PAES} & {NSGA-II} & {MOPSA} \\
\midrule
10\#3 & 0 & 0.115 & 0.695 & 0.545 & 0.657 & 0.741 \\
\vdots\\
30\#8 & 0 & 0 & 1 & 0.327 & 0.296 & 0.745 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}

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