0

How to center data in table when the first cell is split to two rows with \\. Other values are printing to the second rows. I tried multirow, but it doesn't work.

\documentclass[12pt,a4paper]{report}
\usepackage[output-decimal-marker={,}]{siunitx}
\usepackage{booktabs}
\usepackage{tabularx}

\begin{document}

\begin{table}[h!]\footnotesize
    \centering
        \begin{tabular}{|c|cccc}
        \hline


$\omega$ \\ (\si{\degree})& 144,2(21)&  140,0(18)&    141,3(2)&   144,2\\

        \hline
        \end{tabular}

\end{table}
\end{document}
4
  • 5
    Please post a complete compilable code.
    – Bernard
    Dec 21, 2018 at 18:44
  • I added it to my question
    – Elisabeth
    Dec 21, 2018 at 19:24
  • what is \anote? where is defined?
    – Zarko
    Dec 21, 2018 at 19:26
  • Sorry, it was defined in original file
    – Elisabeth
    Dec 21, 2018 at 19:27

2 Answers 2

3

Stack the contents using makecell:

enter image description here

\documentclass{article}

\usepackage{booktabs,makecell}

\begin{document}

\begin{table}
  \centering
  \begin{tabular}{c *{4}{c} }
    \toprule
    \makecell{a \\ b} 
      & 12 & 34 & 56 & 789 \\
    \bottomrule
  \end{tabular}
\end{table}

\end{document}

\makecell sets its argument using a tabular; it's just an easy format to use.

0
3

Is it this that you want?

\documentclass[12pt,a4paper]{report}
\usepackage[output-decimal-marker={,}]{siunitx}
\usepackage{booktabs}
\usepackage{tabularx, makecell}

\NewDocumentCommand{\anote}{}{\makebox[0pt][l]{$^*$}}

\begin{document}

\begin{table}[h!]\footnotesize
    \centering
        \begin{tabular}{|c|cccc}
        \hline
\makecell{$\omega$ \\ (\si{\degree})}& 144,2(21)& 140,0(18)& 141,3(2)& 144,2\anote\\
        \hline
        \end{tabular}
\end{table}

\end{document} 

enter image description here

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .