I have problems translating this table (from Online table generator) to tabularx
environment so it would be coherent with the rest of Tables of my document. Could you kindly help me? Thanks!
\documentclass{article}
\usepackage{multirow}
\usepackage{graphicx}
\begin{document}
\begin{table}[]
\centering
\caption{My caption}
\resizebox{\textwidth}{!}{%
\begin{tabular}{cccccc}
\hline
1 & 2 & 3 & 4 & 5 & 6 \\
\hline
\multirow{2}{*}{Pepe} & \multirow{2}{*}{a} & \multirow{2}{*}{b} & \multirow{2}{*}{c} & \multirow{2}{*}{d} & e \\
& & & & & f \\
\hline
\multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} & \multicolumn{1}{l}{} \\
\hline
\end{tabular}%
}
\end{table}
\end{document}
That is, the table should start by:
\documentclass{article}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{tabularx}
\begin{document}
\begin{table}
\begin{tabularx}{\textwidth}
\end{tabularx}
BLA, BLA, BLA.
\end{table}
\end{document}
Best Answer
Here are two solutions. The first uses a
tabularx
environment, with all six columns using a centered version of the X column type. The second uses atabular*
environment, with all six columns using thec
column type. Both solutions occupy the full width of the textblock.Since
\multicolumn{1}{l}{}
does nothing at all, you might as well omit those instructions.