0

What is wrong with this please? I have error

! Undefined control sequence. Fit& 1& 2& 3& 4& 5& 6& 7& 8& 9& \cellcolor

Thank you

\documentclass[12pt,a4paper]{report}
\usepackage[locale=FR]{siunitx}
\usepackage{booktabs}
\usepackage{xcolor}

\begin{document}


\noindent
\textbf{Konvergence - MOST a BRITE}

\begin{table}[h!!]
\renewcommand{\arraystretch}{1.45}
\scriptsize
\begin{tabular}{r|S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]}

Fit&    1&  2&  3&  4&  5&  6&  7&  8&  9& \cellcolor{blue!25}10 &  11\\

\end{tabular}
\end{table}

\end{document} 
3
  • why [h!!] ? (the second ! does nothing) Apr 14 '19 at 15:48
  • @DavidCarlisle There are actually more problems with his table than that.
    – user156344
    Apr 14 '19 at 16:10
  • 1
    @JouleV "start at the very beginning" :-) Apr 14 '19 at 16:12
4

You need to load table option of xcolor, which loads colortbl containing \cellcolor, etc.

\documentclass[12pt,a4paper]{report}
\usepackage[locale=FR]{siunitx}
\usepackage{booktabs}
\usepackage[table]{xcolor}
\begin{document}
\noindent
\textbf{Konvergence - MOST a BRITE}
\begin{table}[h!!]
\renewcommand{\arraystretch}{1.45}
\scriptsize
\begin{tabular}{r|S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]S[table-format=5.6,table-auto-round]}
Fit&    1&  2&  3&  4&  5&  6&  7&  8&  9& \cellcolor{blue!25}10 &  11\\
\end{tabular}
\end{table}
\end{document} 

Btw why is your table so wide?

3
  • 2
    for column specifying consider shorter \begin{tabular}{r|*{11}{S[table-format=5.6,table-auto-round]}} :-)
    – Zarko
    Apr 14 '19 at 16:45
  • and your table is to wide that can be fit in text width.
    – Zarko
    Apr 14 '19 at 16:51
  • This solution did not work for me, but I have a similar case to the OP.
    – Galen
    Sep 21 at 2:31

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.