I am trying to draw a table like this using IEEE trans template. I don't even know where to start. Any suggestions?
-
2You can start with www.tablesgenerator.com and improve from there.– Phelype OleinikDec 12, 2017 at 19:26
-
Thanks. But I am not sure if it can rotate the contents of the table as shown.– AbdulhameedDec 12, 2017 at 19:32
1 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 the NB
to get a gap between the B
and the horizontal rule.
\documentclass{article}
\usepackage{multirow} % For multirows
\usepackage{amssymb} % For the checkmark
\usepackage{graphicx} % For the rotation
\usepackage{array} % To enlarge the vertical space of the table's contents
\begin{document}
\begin{table}[]
\setlength\extrarowheight{2pt}
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{l|l|l|l|l|l|l|l|l|l|l|}
\cline{2-11}
\multirow{2}{*}{} & \multirow{2}{*}{Suggestions} & \multicolumn{9}{c|}{Other side} \\ \cline{3-11}
& & & & & & & \rotatebox{90}{NB\phantom{.}} & & & \\ \hline
\multicolumn{1}{|l|}{\multirow{4}{*}{\rotatebox{90}{Based}}} & & & & & & & & \checkmark & \checkmark & \\ \cline{2-11}
\multicolumn{1}{|l|}{} & Your Answer & & & \checkmark & & \checkmark & \checkmark & & & \checkmark \\ \cline{2-11}
\multicolumn{1}{|l|}{} & & \checkmark & & & \checkmark & & & & & \\ \cline{2-11}
\multicolumn{1}{|l|}{} & & \checkmark & & & & & & & & \\ \hline
\end{tabular}
\end{table}
\end{document}
Which produces:
Now you can play changing the l
alignment characters to p{}
and get different column widths, but this I'll leave up to you ;)
-
-
1+1. One more suggestion: Load the
array
package and issue the instruction\setlength\extrarowheight{2pt}
.– MicoDec 12, 2017 at 20:03 -
-
2Just after
\begin{table}
if it's only for this one. In the preamble for all tables.– BernardDec 12, 2017 at 20:45 -
1@Abdulhameed My bad, I changed in the picture but not in the code. To rotate something in LaTeX, use
\rotatebox{angle}{something in LaTeX}
. You have to\usepackage{graphicx}
. I updated my answer with Mico's suggestion and fixed this issue. Dec 13, 2017 at 13:02