1

the following code produces a table with larger row heights than needed. I have already defined new columns (for coloring the columns). Any ideas how I can shrink the row height?

\documentclass{article}


\usepackage{booktabs, multicol, multirow}
\usepackage[table]{xcolor}

\usepackage{graphicx}

\usepackage{bigstrut}
\usepackage{caption}


\newcommand{\mc}[2]{\multicolumn{#1}{c}{#2}}
\definecolor{Gray}{gray}{0.85}
\definecolor{LightCyan}{rgb}{0.88,1,1}

\newcolumntype{a}{>{\columncolor{Gray}}c}
\newcolumntype{b}{>{\columncolor{white}}c}

\begin{document}





% Table generated by Excel2LaTeX from sheet 'Sheet2'
\begin{table}[htbp]
  \centering
  \caption{Add caption}
    \hspace*{-2.5cm}\begin{tabular}{|r|b|a|b|a|b|a|b|a|}
    \hline
          & \multicolumn{8}{c|}{\textbf{Low Measurement Error Area Euclidean Distance Asymmetry Rankings }} \bigstrut\\
\cline{2-9}          & \multicolumn{1}{c}{\textbf{Unscaled }} & \multicolumn{1}{c}{\textbf{Unscaled }} & \multicolumn{1}{c}{\textbf{Scaled}} & \multicolumn{1}{c}{\textbf{Scaled }} & \multicolumn{1}{c}{\textbf{Unscaled }} & \multicolumn{1}{c}{\textbf{Unscaled }} & \multicolumn{1}{c}{\textbf{Scaled }} & \textbf{Scaled } \bigstrut[t]\\
          & \multicolumn{1}{c}{\textit{\textbf{DA(cent)}}} & \multicolumn{1}{c}{\textit{\textbf{Mean DA}}} & \multicolumn{1}{c}{\textit{\textbf{ DA(cent)}}} & \multicolumn{1}{c}{\textit{\textbf{Mean DA}}} & \multicolumn{1}{c}{\textit{\textbf{FA(cent)}}} & \multicolumn{1}{c}{\textit{\textbf{Mean FA}}} & \multicolumn{1}{c}{\textit{\textbf{FA(cent)}}} & \textit{\textbf{Mean FA}} \bigstrut[b]\\
\cline{2-9}     \multicolumn{1}{|c|}{\parbox[t]{4mm}{\multirow{16}[48]{*}{\rotatebox[origin=c]{90}{\textbf{Fly Number}}}}} & 9     & 9     & 9     & 7     & 9     & 7     & 9     & 7 \bigstrut[t]\\
    \multicolumn{1}{|c|}{} & 23    & 19    & 23    & 9     & 23    & 22    & 23    & 22 \\
    \multicolumn{1}{|c|}{} & 19    & 7     & 19    & 19    & 19    & 9     & 19    & 14 \\
    \multicolumn{1}{|c|}{} & 2     & 23    & 2     & 2     & 2     & 19    & 2     & 9 \\
    \multicolumn{1}{|c|}{} & 7     & 2     & 7     & 16    & 7     & 14    & 7     & 13 \\
    \multicolumn{1}{|c|}{} & 12    & 16    & 12    & 15    & 13    & 23    & 13    & 19 \\
    \multicolumn{1}{|c|}{} & 16    & 15    & 16    & 23    & 12    & 12    & 12    & 12 \\
    \multicolumn{1}{|c|}{} & 15    & 1     & 15    & 1     & 16    & 13    & 16    & 10 \\
    \multicolumn{1}{|c|}{} & 8     & 8     & 8     & 3     & 15    & 20    & 15    & 24 \\
    \multicolumn{1}{|c|}{} & 24    & 4     & 24    & 13    & 11    & 10    & 11    & 23 \\
    \multicolumn{1}{|c|}{} & 1     & 12    & 1     & 21    & 8     & 24    & 8     & 5 \\
    \multicolumn{1}{|c|}{} & 18    & 6     & 18    & 6     & 20    & 21    & 20    & 18 \\
    \multicolumn{1}{|c|}{} & 6     & 24    & 6     & 4     & 17    & 2     & 17    & 20 \\
    \multicolumn{1}{|c|}{} & 4     & 3     & 4     & 8     & 21    & 5     & 21    & 3 \\
    \multicolumn{1}{|c|}{} & 22    & 18    & 22    & 10    & 24    & 18    & 24    & 21 \\
    \multicolumn{1}{|c|}{} & 10    & 13    & 10    & 12    & 3     & 16    & 5     & 16 \\
    \multicolumn{1}{|c|}{} & 14    & 21    & 14    & 24    & 5     & 1     & 3     & 2 \\
    \multicolumn{1}{|c|}{} & 5     & 10    & 3     & 18    & 1     & 3     & 1     & 1 \\
    \multicolumn{1}{|c|}{} & 3     & 17    & 5     & 17    & 14    & 11    & 14    & 11 \\
    \multicolumn{1}{|c|}{} & 21    & 14    & 21    & 20    & 10    & 6     & 10    & 17 \\
    \multicolumn{1}{|c|}{} & 17    & 22    & 17    & 14    & 22    & 8     & 22    & 8 \\
    \multicolumn{1}{|c|}{} & 20    & 20    & 20    & 11    & 18    & 17    & 18    & 6 \\
    \multicolumn{1}{|c|}{} & 11    & 11    & 11    & 22    & 6     & 15    & 6     & 15 \\
    \multicolumn{1}{|c|}{} & 13    & 5     & 13    & 5     & 4     & 4     & 4     & 4 \bigstrut[b]\\
    \hline
    \end{tabular}%
  \label{tab:addlabel}%
\end{table}

\end{document}
  • welcome to tex.sx!, I added \documentclass so your example can be run and removed unneeded packages (you don't ever need epsfig unless you are aiming for compatibility with documents from the 1980s) – David Carlisle Feb 1 '15 at 0:03
  • Thanks, I am grateful for the community resource and the answer! – Greg Feb 1 '15 at 15:46
1

I'm not sure I'd recommend it but I think you are asking for

\begin{table}[htbp]
\renewcommand\arraystretch{.8}

which makes the table take less vertical space.

Unreleated but for numeric columns it's more normal to use r rather than c so the digits line up, or use one of the numeric alignment columns from dcolumn or siunitx packages.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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