# How to put math symbol rotated with 90 degree in table cell?

\documentclass{article}
\usepackage{tabularx,multirow,booktabs}
\begin{document}
\begin{table}[h]
\centering
\begin{tabular}{@{}ccccccccc@{}}
\toprule
\multicolumn{2}{c}{} & \multicolumn{7}{c}{\bfseries COLUMN}\\
\multicolumn{2}{c}{} & \textbf{x} & & \textbf{y} & & \textbf{z} && x\\
\multirow{3}{*}{\bfseries ROW} & \textbf{p} & 6 &$>$& 4 &$<$& 5 &$<$&6\\
& \textbf{q} & 5 &$<$& 16 &$>$& 5 &=& 5\\
& \textbf{r} & 2 &$<$& 4 &$>$& -7 &$<$& 2\\
\bottomrule
\end{tabular}
\caption{Strategies}
\label{tab:dominantColumn}
\end{table}
\end{document}


I want to do this type of comparison for row wise also. How can I put the symbol (90 degree shifted needed). > changed to v and < change to ^.

I need to something like this.

\begin{table}[h]
\centering
\begin{tabular}{@{}ccccc@{}}
\toprule
\multicolumn{2}{c}{} & \multicolumn{3}{c}{\bfseries COLUMN}\\
\multicolumn{2}{c}{} & \textbf{x} & \textbf{y} & \textbf{z}\\
\multirow{4}{*}{\bfseries ROW} & \textbf{p} & 6 & 4 & 5\\
&&&&\\%here the symbo
& \textbf{q} & 5 & 16 & 5\\
&&&&\\%here the symbo
& \textbf{r} & 2 & 4 & -7\\
&&&&\\%here the symbol
& \textbf{p} & 6 & 4 & 5\\
\bottomrule
\end{tabular}
\caption{Strategies}
\label{tab:dominantRow}
\end{table}


\rotatebox from graphicx can do it for you. Here I only add one "^" and one "v". To make the symbol accurately centered, you may need option origin=c, as suggested by @leandriis in his comment.

\documentclass{article}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{graphicx}
\newcommand\downsym{\rotatebox[origin=c]{90}{$<$}}
\newcommand\upsym{\rotatebox[origin=c]{90}{$>$}}
\begin{document}
\begin{table}[h]
\centering
\begin{tabular}{@{}ccccc@{}}
\toprule
\multicolumn{2}{c}{} & \multicolumn{3}{c}{\bfseries COLUMN}\\
\multicolumn{2}{c}{} & \textbf{x} & \textbf{y} & \textbf{z}\\
\multirow{4}{*}{\bfseries ROW} & \textbf{p} & 6 & 4 & 5\\
&&&&\\%here the symbo
& \textbf{q} & 5 & 16 & 5\\
&\downsym&&&\\%here the symbo
& \textbf{r} & 2 & 4 & -7\\
&&&\upsym&\\%here the symbol
& \textbf{p} & 6 & 4 & 5\\
\bottomrule
\end{tabular}
\caption{Strategies}
\label{tab:dominantRow}
\end{table}
\end{document}


• As you might have noticed, the rotated symbols are not vertically centered (especially the \downsym). To overcome this you might want to add the option origin=c as in \newcommand\downsym{\rotatebox[origin=c]{90}{$<$}} – leandriis Apr 6 at 11:02
• @leandriis Thanks for pointing that out! I did not even observe it. I edited my answer. – user156344 Apr 6 at 11:13

Here is a different approach using the symbols \vee and \wedge:

\documentclass{article}
\usepackage{multirow,booktabs}
\begin{document}
\begin{table}[h]
\centering
\begin{tabular}{@{}ccccc@{}}
\toprule
& & \multicolumn{3}{c}{\bfseries COLUMN}\\
& & \textbf{x} & \textbf{y} & \textbf{z}\\
\multirow{7}{*}{\bfseries ROW} & \textbf{p} & 6 & 4 & 5\\
&&$\vee$&$\wedge$&\\%here the symbo
& \textbf{q} & 5 & 16 & 5\\
&&&&\\%here the symbo
& \textbf{r} & 2 & 4 & -7\\
&&&&\\%here the symbol
& \textbf{p} & 6 & 4 & 5\\
\bottomrule
\end{tabular}
\caption{Strategies}
\label{tab:dominantRow}
\end{table}
\end{document}


Please note, that I have changed \multirow{4} to \multirow{7} in order to vertically center ROW. You might also want to keep in mind that the z column is wider than the x and y column. This is because the fcolumn header is wider than the combined width of the three columns. If you want to get rid of this, you might be interested in Table column widths disproportionate due to multicolumn cell being too long

• You might want to consider using a real (math) minus for the -7 entry. Right now, it's a hyphen, and looks too narrow. – barbara beeton Apr 6 at 20:35