質問: ``` \documentclass[12pt,a4paper]{report} \begin{document} \begin{center} \begin{tabular}{|c|c|c|c|c|} \hline {Après-midi}\hspace{1cm}&\hspace{1cm}{Matin} & \hspace{1cm} \\ \hline {\small \begin{tabular}{c|c|c} x & y & z \\ \hline 19h25 & 12h56 & 41 \\ \hline 20h32 & 14h00 & 37 \\ \hline 21h43 & 15h13 & 38 \\ \hline 22h48 & 16h23 & 43 \\ \hline 23h51 & 17h20 & 51 \\ \hline 22h48 & 16h23 & 59 \\ \hline 22h48 & 16h23 & 67 \\ \hline \end{tabular} } & {\small \begin{tabular}{c|c|c} x & y & z \\ \hline 6h56 & 0h35 & 45 \\ \hline 7h56 & 1h33 & 38 \\ \hline 9h08 & 2h42 & 36 \\ \hline 10h19 & 3h54 & 40 \\ \hline 20h32 & 14h00 & 47 \\ \hline -- & 14h00 & 55 \\ \hline 0h25 & 6h25 & 63 \\ \hline \end{tabular}} & 1 \end{tabular} \end{center} \end{document} ``` ![enter image description here](https://i.stack.imgur.com/LI5mM.png) i want get 1,2,3,4,5,6,7 beside 41,37,... I get only 1 ?
回答: I agree with the comment about nested tabulars, but I've left that part unchanged. Perhaps this is what you want? If you only need the numbering on last column, then you need to remove the `T` column specification (and all the final `&`s) from the 'Après-midi' column. I've used the `\thead` macro from the very useful `makecell` package to allow line breaks in centred column headings ``` \documentclass12pt,a4paper]{report} \usepackage{array} \usepackage{makecell} \usepackage{etoolbox} \newcounter{tcount} \newcolumntype{T}{>{\stepcounter{tcount}\thetcount}c} \AtBeginEnvironment{tabular}{\setcounter{tcount}{0}} \begin{document} \begin{center} \begin{tabular}{|c|c|c|c|} \hline \thead{Après-midi\\Afternoon}&\thead{Matin\\Morning} \\ \hline {\small \begin{tabular}{c|c|c|T} x & y & z &\multicolumn{1}{c}{} \\ \hline 19h25 & 12h56 & 41 & \\ \hline 20h32 & 14h00 & 37 & \\ \hline 21h43 & 15h13 & 38 & \\ \hline 22h48 & 16h23 & 43 & \\ \hline 23h51 & 17h20 & 51 & \\ \hline 22h48 & 16h23 & 59 & \\ \hline 22h48 & 16h23 & 67 & \end{tabular} } & {\small \begin{tabular}{c|c|c|T} x & y & z & \multicolumn{1}{c}{} \\ \hline 6h56 & 0h35 & 45 & \\ \hline 7h56 & 1h33 & 38 & \\ \hline 9h08 & 2h42 & 36 & \\ \hline 10h19 & 3h54 & 40 & \\ \hline 20h32 & 14h00 & 47 & \\ \hline -- & 14h00 & 55 & \\ \hline 0h25 & 6h25 & 63 & \end{tabular}} \\ \hline \end{tabular} \end{center} \end{document} ``` ![output of code