1

I am beginner with Latex (windows 10, Texmaker and Miktex) and I would like to reproduce this kind of table :

enter image description here

I thought that this question could help me : problem with Multirow. But when I tried to compile @Zarko 's answer, I have this error : ! Package inputenc Error: Invalid UTF-8 byte sequence. I didn't manage to fix it... Please, any clue would be great (whether on UTF or table problem) !

Kindly yours

EDIT :

Here is the code I copied-pasted :

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{multirow}

\begin{document}
\begin{figure}
    \centering
\begin{tabular}{|c|c|c|c|c|}
    \hline
\multicolumn{2}{|c|}{Corpus}    & Français  & Anglais   & Allemand   \\ \hline
\multirow{3}{*}{Apprentissage}  & phrases   & \multicolumn{3}{c|}{600.000}  \\ \cline{2-5}
                                & Mot & ? & ? & ?                           \\ \cline{2-5}
                                & Vocabulaire & ? & ? & ?                   \\ \hline
\end{tabular}
\caption{Caractéristique du corpus \textsc{Europarl}}
\label{fig:typeDistribution}
\end{figure}
\end{document}

Whether I remove \usepackage[utf8]{inputenc} it doesn't compile anything.

9
  • Welcome to TeX SX! Could you post what you tried?
    – Bernard
    Mar 27, 2020 at 17:33
  • 1
    I test my answer in given link again. It still works fine. Meanwhile for recent version of the article package utf8 is default input encoding, so in my answer you can remove code line \usepackage[utf8]{inputenc}. However, please check, how old is your LaTeX installation. It may now be a time to update it now :-)
    – Zarko
    Mar 27, 2020 at 18:02
  • 1
    What cause your problem is not possible to figured out without seeing a MWE (a small complete document with your table), which reproduce your problem.
    – Zarko
    Mar 27, 2020 at 18:04
  • @Zarko I have recieved this error sometime because of when I copy and paste from a web site you et some strange characters with you. Often a ligature.
    – Sveinung
    Mar 27, 2020 at 18:15
  • 1
    I test your MWE, it works fine.
    – Zarko
    Mar 30, 2020 at 9:45

2 Answers 2

0

Table can be done like this:

\documentclass{article}
\usepackage{booktabs}
\usepackage{multirow}

\begin{document}
\begin{tabular}{ccccc}
& & Parameters A & Parameters B & Parameters C\\
\midrule
\multirow{4}{*}{Cell 1} & Value 1  & 1A1 & 1B1 & 1C1\\
 & Value 1  & 1A1 & 1B1 & 1C1\\
\cmidrule{2-5}
& Value 1  & 1A1 & 1B1 & 1C1\\
 & Value 1  & 1A1 & 1B1 & 1C1\\
 \midrule
\multirow{4}{*}{Cell 1} & Value 1  & 1A1 & 1B1 & 1C1\\
 & Value 1  & 1A1 & 1B1 & 1C1\\
\cmidrule{2-5}
& Value 1  & 1A1 & 1B1 & 1C1\\
 & Value 1  & 1A1 & 1B1 & 1C1\\
\end{tabular}
\end{document}
1

I suggest you employ the booktabs package for its macros that can generate well-spaced horizontal rules -- specifically, the \midrule and \cmidrule macros -- and the multirow package for its \multirow command. Observe that the first argument of \multirow need not be integer-valued.

While you're at it, you may also want to provide a bit more visual structure to the header material. Doing so lets you snug up rows 3 to 5 to rows 1 and 2.

enter image description here

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

\begin{document}
\begin{center}
\sffamily % optional
\begin{tabular}{@{}llccc@{}}
%\toprule
& & \multicolumn{3}{c@{}}{Parameters}\\
\cmidrule(l){3-5}
& & A & B & C\\
\midrule
\multirow{4.4}{*}{Cell 1} 
    & Value 1  & 1A1 & 1B1 & 1C1\\
    & Value 2  & 1A2 & 1B2 & 1C2\\
\cmidrule(l){2-5}
    & Value 3  & 1A3 & 1B3 & 1C3\\
    & Value 4  & 1A4 & 1B4 & 1C4\\
\midrule
\multirow{4.4}{*}{Cell 2} 
    & Value 1  & 2A1 & 2B1 & 2C1\\
    & Value 2  & 2A2 & 2B2 & 2C2\\
\cmidrule(l){2-5}
    & Value 3  & 2A3 & 2B3 & 2C3\\
    & Value 4  & 2A4 & 2B4 & 2C4\\
%\bottomrule
\end{tabular}
\end{center}
\end{document}

You must log in to answer this question.

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