I am trying to draw a table like this using IEEE trans template. I don't even know where to start. Any suggestions?
[Tex/LaTex] Table with a tick, horizontal text and multiple vertical and horizontal columns
multicolumnmultirowtablesvertical alignment
Related Solutions
You could achieve the double line by using \hhline{#=#===#=#}
as in
But if you zoom out you'll see some weird details as the one inside the red circle (but visible along the lines):
But as you would read somewhere else, I'd advise against the use of vertical rules to improve readability. Not to mention that you would have a much cleaner code.
So this is my suggestion for your table. It uses the booktabs
package which makes for much better lines:
And the code:
\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
\usepackage{booktabs}
\pagestyle{empty}
\begin{document}
\begin{tabular}{ccccc}
\toprule
\multirow{2}{*}{n} & \multicolumn{3}{c}{p} & \multirow{2}{*}{k} \\ \cmidrule{2-4}
& .1 & .25 & .5 & \\ \midrule
& \ldots & \ldots & \ldots & 1 \\ \cmidrule{2-4}
3 & \ldots & \ldots & \ldots & 2 \\ \cmidrule{2-4}
& \ldots & \ldots & \ldots & 3 \\ \midrule
& \ldots & \ldots & \ldots & 1 \\ \cmidrule{2-4}
4 & \ldots & \ldots & \ldots & 2 \\ \cmidrule{2-4}
& \ldots & \ldots & \ldots & 3 \\ \midrule
& \ldots & \ldots & \ldots & 1 \\ \cmidrule{2-4}
5 & \ldots & \ldots & \ldots & 2 \\ \cmidrule{2-4}
& \ldots & \ldots & \ldots & 3 \\ \bottomrule
\end{tabular}
\end{document}
This should help. It just shows how your code should look like after using Harish's recommendation:
\documentclass[twocolumn]{article}
\usepackage{lipsum}%Just for introducing dummy text.
\usepackage{dblfloatfix}
\begin{document}
\lipsum[1-4]%dummy text
\begin{table*}[h]%Using table* instead of table is what makes the table use the two columns.
\centering
\begin{tabular}{|c|c|c|}
Data & Data & Data \\
Data & Data & Data \\
Data & Data & Data \\
\end{tabular}
\caption{This is a table with data}
\end{table*}
\lipsum[3-10]%Dummy text
\end{document}
Here's a screenshot of the result.
Best Answer
Using the online LaTeX Table Generator with a few clicks you can do this:
This is the best I can do in the site. Then moving the generated code to LaTeX, we can do a few modifications to get the code below.
Update
I incorporated Mico's suggestion of the
\extrarowheight
, I also added a\phantom{.}
after theNB
to get a gap between theB
and the horizontal rule.Which produces:
Now you can play changing the
l
alignment characters top{}
and get different column widths, but this I'll leave up to you ;)