LaTeX top row on stem and leaf table

I am trying to represent the stem and leaf structure in a table environment in LaTeX using the following:

\begin{table}[htbp]
  \centering
  \caption{Stem Plot of sit ups, Key: $1 | 1= 1.1$}
    \begin{tabular}{r|l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}}
   \multirow{2}{*}{} Stem & Leaf     \\
    \hline
    1     & 1     & 1     & 2     & 3     & 3     & 4     & 4     &       &  \\    
    1     & 5     & 6     & 6     & 8     &       &       &       &       &  \\    
    2     & 0     & 3     &       &       &       &       &       &       &  \\    
    2     & 7     & 8     &       &       &       &       &       &       &  \\    
    3     &       &       &       &       &       &       &       &       &  \\    
    3     & 5     & 7     & 8     & 8     &       &       &       &       &  \\
    4     & 0     & 0     & 0     & 1     & 2     & 4     & 4     & 4     &  \\
    4     & 5     & 5     & 6     & 7     & 7     & 7     & 8     & 8     & 9 \\
    \end{tabular}
  \label{tab:addlabel}

\end{table}

But when I do this, the second column is too wide, and there is a space between the 2nd and 3rd columns of leaf values. How can I make the Sheet cell overlap in the next column or somehow remove the space?

alt text

+3
source share
1 answer

You can put Leafin \multicolumn{9}{l}{Leaf}. The number ( 9here) shows how many columns should occupy, lgives cell formatting. If you need the right bar, you should, by the way, use it l|.

Now you do not need \multirow.

+2
source

Source: https://habr.com/ru/post/1768742/


All Articles