0

I will post down here the tableI need to create in LaTeX.

I actually have no clue with how to proceed. I only know basics tables codes.

Any help will be really appreciated!

P.s. I drew here a sample. I need actually more than three $\alpha$ cells and more than nine $t$ cells,but that won't be a problem of course: I will extend the code.

Thank you!!

enter image description here

About the size: I would like for the table to be quite large.

Not a landscape mode, but let's say $18$ cm in length. The height will depend upon how many $t$ and $\alpha$ I will put inside!

  • 2
    This is pretty straightforward with multirow and \cline etc. statements – user31729 Feb 8 '17 at 19:33
  • Do you have 3 rows for t = per each value of α? – Bernard Feb 8 '17 at 19:34
  • @Bernard I will actually have $7$ rows for $t$, another $7$ or $8$ total rows for $\alpha$ ! – Henry Feb 8 '17 at 19:35
  • I asked to know if the number of t = rows is even or add. In favourable cases (odd number) one can do without using \multirow, which very often requires some manual vertical adjustment. – Bernard Feb 8 '17 at 19:38
  • @Bernard Then I will have seven values for t, and7 for$\alpha$! Odd odd odd! – Henry Feb 8 '17 at 19:41
5

Taking partly into account an odd number of grouped rows, here a way, with multirow, array, caption and siunitx for the numbers alignment on the decimal dot in the last column.

\documentclass{article}

\usepackage[table]{xcolor}
\usepackage{multirow, array, caption}
\usepackage{siunitx}

\begin{document}

\begin{table}[!htb]
  \sisetup{table-format =1.11, table-number-alignment=center}
  \centering\setlength\extrarowheight{2pt}
  \caption{Title here}$ \begin{array}{|*{3}{c|}>{\color{red}}S|}%
  \hline
  \multirow{9}{*}{$ \sum_k f(k, \alpha, t) $}
  & & t = 0.1 & 0.123456789 \\
  \cline{3-4}  %
  &  \alpha= 1  & t = 0.5 & 1.04400440\\
  \cline{3-4}%
  &  & t = 0.9 & 2.71828182845 \\
  \cline{2-4}%
  & &t = 0.1 & 0.123456789\\ %
  \cline{3-4}%
  & \alpha=2  & t = 0.5 & 1.04400440\\
  \cline{3-4}%
  &  & t = 0.9 & 2.71828182845 \\
  \cline{2-4}%
  & &t = 0.1 &   \\
  \cline{3-4}%
  &  \alpha=3  & t = 0.5 &  \\
  \cline{3-4}%
  &  & t = 0.9 &  \\
  \hline%
  \end{array} $
\end{table}

\end{document} 

enter image description here

5
\documentclass{article}
\usepackage{multirow}
\begin{document}

\begin{table}[htb]
\centering
\caption{Title here}
\label{my-label}
\begin{tabular}{|c|c|c|c|}
\hline
\multirow{9}{*}{$\sum_kf(k,\alpha,t)$} & \multirow{3}{*}{$\alpha=1$} & t=0.1 & 0.123456789   \\ \cline{3-4} 
                                       &                             & t=0.5 & 1.04400440    \\ \cline{3-4} 
                                       &                             & t=0.9 & 2.71828182845 \\ \cline{2-4} 
                                       & \multirow{3}{*}{$\alpha=2$} & t=0.1 &               \\ \cline{3-4} 
                                       &                             & t=0.5 &               \\ \cline{3-4} 
                                       &                             & t=0.9 &               \\ \cline{2-4} 
                                       & \multirow{3}{*}{$\alpha=3$} & t=0.1 &               \\ \cline{3-4} 
                                       &                             & t=0.5 &               \\ \cline{3-4} 
                                       &                             & t=0.9 &               \\ \hline
\end{tabular}
\end{table}

\end{document}

If you need a more readable version, consider using the booktabs package:

\documentclass{article}
\usepackage{multirow,booktabs}
\begin{document}

\begin{table}[htb]
\centering
\caption{Title here}
\label{my-label2}
\begin{tabular}{ccl}
\toprule
 $\alpha$  & $t$   &  $\sum_kf(k,\alpha,t)$ \\ \midrule
 1         & 0.1   &  0.123456789           \\ 
           & 0.5   &  1.04400440            \\ 
           & 0.9   &  2.71828182845         \\ \midrule
 2         & 0.1   &                        \\  
           & 0.5   &                        \\  
           & 0.9   &                        \\ \midrule 
 3         & 0.1   &                        \\ 
           & 0.5   &                        \\  
           & 0.9   &                        \\ \bottomrule
\end{tabular}
\end{table}

\end{document}

enter image description here

  • That is so cool! Thank you! Any way to make it larger? – Henry Feb 8 '17 at 19:49
  • Yes, of course, if you edit the question adding the exact size I can edit my answer – AboAmmar Feb 8 '17 at 19:52
  • Done! I just need a length of about 18 cm. The height will depend on the total number son elements I'll put inside I guess. It would be awesome to have a clear well readable table! Thank you so much for what you wrote! – Henry Feb 8 '17 at 19:55
  • I just managed to learn about \resizebox and I'm don for what concerns the size! Thank you anyway! ^^ – Henry Feb 8 '17 at 20:08
  • I'd avoid the \multirow: placing 1, 2 and 3 at the top implies the value stays the same for the empty cells underneath. Anyway, the “transpose” is what I'd use too. – egreg Feb 8 '17 at 20:30
3

I assume it's important that the material in the first column be displayed in the blue and the material in the final column be displayed in red. I would also like to suggest you use an array environment since it looks like all contents should be rendered in math mode.

The following solution gets by without any \multirow directives.

enter image description here

\documentclass{article}
\usepackage{array} % for '\extrarowheight' macro
\usepackage{xcolor}% for '\color' macro
\begin{document}
\[
\setlength\extrarowheight{2pt} % provide for a slightly more "open" look
\begin{array}{| >{\color{blue}}c | c | c | >{\color{red}}c |} \hline
                     &          & t=0.1 & 0.123545 \\ \cline{3-4}
                     & \alpha=1 & t=0.5 & 1.044044 \\ \cline{3-4}
                     &          & t=0.9 & 2.718281 \\ \cline{2-4}
                     &          & t=0.1 & \ldots   \\ \cline{3-4}
\sum_k f(k,\alpha,t) & \alpha=2 & t=0.5 & \ldots   \\ \cline{3-4}
                     &          & t=0.9 & \ldots   \\ \cline{2-4}
                     &          & t=0.1 & \ldots   \\ \cline{3-4}
                     & \alpha=3 & t=0.5 & \ldots   \\ \cline{3-4}
                     &          & t=0.9 & \ldots   \\ \hline
\end{array}
\]
\end{document}

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.