Eu tenho que transformar colunas da tabela em linhas e todos os títulos, bem como todas as partições

Eu tenho que transformar colunas da tabela em linhas e todos os títulos, bem como todas as partições

insira a descrição da imagem aqui

Aqui está minha tabela e quero alterar a coluna das linhas, ou seja, todos os títulos que estão escritos na coluna e a mesma divisão das colunas em linhas. Por favor, me ajude.

\begin{table*}
\centering
\setlength\extrarowheight{2pt}
\begin{tabular}{|p{1cm}|p{1cm}|p{1cm}|p{1cm}|p{1cm}|p{1cm}|p{1cm}|p{1cm}|p{1cm}|p{1cm}|p{1cm}|p{1cm}|p{1cm}|}
\hline
t&\multicolumn{3}{c}{SH}&\multicolumn{3}{|c|}{SH}&\multicolumn{3}{|c|}{MH }&\multicolumn{3}{|c|}{MH}\\ \cline{2-13}
           &&&Difference&&Difference&&&Difference&&&Differences\\ \cline{2-13}
Unschedule     &5.01  & ---    &---& 5.01&--- &---&22.46&---&---& 24.54  &--- &\\
            &4.31  &13.97\%&0.7&4.68&6.58\%&0.33&12.78 &43.09\%&11.78 &13.92&43.27\%&10.62\\
            &3.24  &35.32\%&1.77&3.48&30.53\%&1.53&14.70&34.55\%&9.84&12.98&47.10\%&11.56\\
             &3.73  &25.54\%&1.28&3.64 &27.34\%&1.37&12.70&43.45\%&11.48&14.01&42.66\%&10.53\\
           &3.09  &38.32\%&1.92&3.13 &37.52\%& 1.88&11.73&47.77\%&12.78&12.01&50.08\%&12.53\\ \hline
\end{tabular}
\end{table*}

Responder1

Aqui está uma maneira de fazer isso. Substituí a maioria das p{1cm}colunas por Scolunas, para siunitxgarantir o alinhamento das colunas no ponto decimal:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe, a4paper]{geometry}
\usepackage{array, booktabs, multirow, siunitx}

\begin{document}

\begin{table*}
\centering\sisetup{table-format=2.2, table-space-text-post = {\,\%}}
\setlength\extrarowheight{2pt}
\begin{tabular}{|c|c|*{5}{S|}}
 \multicolumn{1}{c}{t} & \multicolumn{6}{c}{Unschedule}\\[2pt]
 \hline
\multirow{3}{*}{SH} & & 5.01 &4.31 & 3.24 & 3.73 &3.09 \\
 & & {—} &13.97 \,\% &35.32 \,\% &25.54 \,\% &38.32 \,\% \\
& Difference & {—} & 0.7 & 1.77 &1.28 &1.92 \\
 \hline
\multirow{3}{*}{SH} & & 5.01 &4.68 & 3.48 &3.64 &3.13 \\
 & & {—} & 6.58 \,\% & 30.53 \,\% &27.34 \,\% &37.52 \,\% \\
  & Difference & {—} &0.33 &1.53 &1.37 & 1.88 \\
 \hline
\multirow{3}{*}{MH} & &22.46 &12.78 &14.70 & 12.70 &11.73 \\
  & & {—} & 43.09 \,\% & 34.55 \,\% & 43.45 \,\% & 47.77 \,\% \\
 & Difference & {—} & 11.78 & 9.84 &11.48 &12.78 \\
 \hline
\multirow{3}{*}{MH} & & 24.54 & 13.92 & 12.98 & 14.01 & 12.01 \\
 & & {—} & 43.27 \,\% & 47.10 \,\% & 42.66\, \% & 50.08 \,\% \\
 & Difference & & 10.62 & 11.56 & 10.53 & 12.53 \\ \hline
\end{tabular}
\end{table*}

\end{document} 

insira a descrição da imagem aqui

informação relacionada