2

I am attempting to reproduce an existing typeset table.

enter image description here

The following code produces this table.

I have not been able to correct the second and third cell vertical spacing in the header row.

Thanks in advance for any advice. To include "All wrong, let's start over."

enter image description here

\documentclass[11pt]{article}
\begin{document}

\begin{center}
\begin{tabular}{c|c|c}
\hline
\rule{0pt}{3ex}
Ratio of unit lengths \\
$u_x : u_y : u_z$ &
Tan. \phi &
Tan. \theta \\[1ex] \hline
\rule{0pt}{5ex}
$\left\{
    \begin{tabular}{c}
        1{\hspace{1em}:\hspace{1em}}1{\hspace{1em}:\hspace{1em}}1 \\
        \textrm{Isometric}
    \end{tabular}\right\}$ &
$\phi = \theta$ &
= $60^\circ$ \\ [3ex]
\begin{tabular}{c@{\hspace{1em}:\hspace{1em}}c@{\hspace{1em}:\hspace{1em}}r}
  2 & 1 & 2 \\
  3 & 1 & 3 \\
  4 & 1 & 4 \\
  5 & 4 & 6 \\
  6 & 5 & 10
\end{tabular} &
\begin{tabular}{r@{\hspace{1em}:\hspace{1em}}c}
   8 & 1 \\
  18 & 1 \\
  32 & 1 \\
   5 & 1 \\
  11 & 1
\end{tabular} &
\begin{tabular}{r@{\hspace{1em}:\hspace{1em}}c}
   8 &  7 \\
  18 & 17 \\
  32 & 31 \\
   3 &  1 \\
   5 &  8
\end{tabular} \\
\hline
\end{tabular}
\end{center}
\end{document}
4

I would do that with makecell. I added some simplification to the code (\hspace{1em} is simply \quad).

\documentclass[11pt]{article}
\usepackage{bigstrut, makecell}

\begin{document}

\begin{center}
\begin{tabular}{c|c|c}
\hline
\rule{0pt}{3ex}
\makecell{Ratio of unit lengths\bigstrut[t] \\
$u_x : u_y : u_z$} &
Tan. $ \phi $ &
Tan. $ \theta $ \\[1ex] \hline
\rule{0pt}{5ex}
$\left\{
    \begin{tabular}{c}
        1{\quad:\quad}1{\quad:\quad}1 \\
        \textrm{Isometric}
    \end{tabular}\right\}$ &
$\phi = \theta$ &
= $60^\circ$ \\ [3ex]
\begin{tabular}{c@{\hspace{1em}:\hspace{1em}}c@{\hspace{1em}:\hspace{1em}}r}
  2 & 1 & 2 \\
  3 & 1 & 3 \\
  4 & 1 & 4 \\
  5 & 4 & 6 \\
  6 & 5 & 10
\end{tabular} &
\begin{tabular}{r@{\hspace{1em}:\hspace{1em}}c}
   8 & 1 \\
  18 & 1 \\
  32 & 1 \\
   5 & 1 \\
  11 & 1
\end{tabular} &
\begin{tabular}{r@{\hspace{1em}:\hspace{1em}}c}
   8 & 7 \\
  18 & 17 \\
  32 & 31 \\
   3 & 1 \\
   5 & 8
\end{tabular} \\
\hline
\end{tabular}
\end{center}

\end{document} 

enter image description here

0

Here is one way to do it: treat the second row in the first header entry as a second row.

\documentclass[11pt]{article}
\begin{document}

\begin{center}
\begin{tabular}{c|c|c}
    \hline
    \rule{0pt}{3ex}
    Ratio of unit lengths &     % first row
    Tan. \phi &
    Tan. \theta \\
    $u_x : u_y : u_z$ & & \\    % second row
    [1ex] \hline
    \rule{0pt}{5ex}
$\left\{
    \begin{tabular}{c}
        1{\hspace{1em}:\hspace{1em}}1{\hspace{1em}:\hspace{1em}}1 \\
        \textrm{Isometric}
    \end{tabular}\right\}$ &
$\phi = \theta$ &
= $60^\circ$ \\ [3ex]
\begin{tabular}{c@{\hspace{1em}:\hspace{1em}}c@{\hspace{1em}:\hspace{1em}}r}
  2 & 1 & 2 \\
  3 & 1 & 3 \\
  4 & 1 & 4 \\
  5 & 4 & 6 \\
  6 & 5 & 10
\end{tabular} &
\begin{tabular}{r@{\hspace{1em}:\hspace{1em}}c}
   8 & 1 \\
  18 & 1 \\
  32 & 1 \\
   5 & 1 \\
  11 & 1
\end{tabular} &
\begin{tabular}{r@{\hspace{1em}:\hspace{1em}}c}
   8 &  7 \\
  18 & 17 \\
  32 & 31 \\
   3 &  1 \\
   5 &  8
\end{tabular} \\
\hline
\end{tabular}
\end{center}
\end{document}

Result:

Result

To center the 2nd and 3rd header also vertically you might need a different table package. There is a way to do it with tabular using m{width}, but it works like p{width} i.e. aligns left, while you wanted center c.

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.