具有特定大小字体和居中列的多页表

具有特定大小字体和居中列的多页表

我想制作一个“具有特定大小字体和居中列的多页表”,到目前为止,我尝试的是使用 longtabu,但是当我设置字体大小时,它会更改整个文档的所有字体。我该如何让它工作?

我的代码:

\section{Deep Neural Network}
    ......
    \scriptsize{
        \begin{longtabu} to \textwidth {|X[1.5,c]|X[3,c]|X[c]|X[c]|}
            \hline
            \rowcolor[HTML]{D7DBDD} 
            \begin{tabular}[c]{@{}c@{}}Migration \\ Algorithm\end{tabular} & Target Metric & \begin{tabular}[c]{@{}c@{}}MAE \end{tabular} & \begin{tabular}[c]{@{}c@{}}WAPE\end{tabular}\\ \hline
            \endhead
            \multirow{7}{*}{PRE} & Total Time (ms) & 5054.95 & 13\% \\ \cline{2-4} 
             & Downtime (ms) & 309.37 & 17\% \\ \cline{2-4} 
             & Total Traffic (MB) & 211.99 & 9\% \\ \cline{2-4} 
             & Throughput (Mbps) & 31.2 & 6\% \\ \cline{2-4} 
             & Performance (\%) & 0.21 & 18\% \\ \cline{2-4} 
             & CPU (\%) & 1.51 & 20\% \\ \cline{2-4} 
             & Memory (MB) & 3.82 & 111\% \\ \hline
            \multirow{7}{*}{POST} & Total Time (ms) & 5133.97 & 15\% \\ \cline{2-4} 
             & Downtime (ms) & 235.66 & 17\% \\ \cline{2-4} 
             & Total Traffic (MB) & 195.05 & 10\% \\ \cline{2-4} 
             & Throughput (Mbps) & 29.1 & 5\% \\ \cline{2-4} 
             & Performance (\%) & 0.58 & 59\% \\ \cline{2-4} 
             & CPU (\%) & 2.06 & 34\% \\ \cline{2-4} 
             & Memory (MB) & 3.54 & 124\% \\ \hline
            \multirow{7}{*}{DTC} & Total Time (ms) & 14874.75 & 32\% \\ \cline{2-4} 
             & Downtime (ms) & 243.6 & 20\% \\ \cline{2-4} 
             & Total Traffic (MB) & 283.27 & 22\% \\ \cline{2-4} 
             & Throughput (Mbps) & 35.12 & 15\% \\ \cline{2-4} 
             & Performance (\%) & 0.24 & 19\% \\ \cline{2-4} 
             & CPU (\%) & 39.79 & 13\% \\ \cline{2-4} 
             & Memory (MB) & 2.73 & 84\% \\ \hline
            \multirow{7}{*}{DLTC} & Total Time (ms) & 5072.98 & 14\% \\ \cline{2-4} 
             & Downtime (ms) & 321.04 & 19\% \\ \cline{2-4} 
             & Total Traffic (MB) & 194.38 & 9\% \\ \cline{2-4} 
             & Throughput (Mbps) & 29.36 & 5\% \\ \cline{2-4} 
             & Performance (\%) & 0.2 & 17\% \\ \cline{2-4} 
             & CPU (\%) & 1.69 & 21\% \\ \cline{2-4} 
             & Memory (MB) & 23.57 & 16\% \\ \hline
             \pagebreak
            \multirow{7}{*}{\begin{tabular}[c]{@{}c@{}}POST\\ DLTC\end{tabular}} & Total Time (ms) & 5608.29 & 16\% \\ \cline{2-4} 
             & Downtime (ms) & 250.38 & 20\% \\ \cline{2-4} 
             & Total Traffic (MB) & 179.56 & 9\% \\ \cline{2-4} 
             & Throughput (Mbps) & 29.77 & 6\% \\ \cline{2-4} 
             & Performance (\%) & 0.59 & 61\% \\ \cline{2-4} 
             & CPU (\%) & 2.09 & 32\% \\ \cline{2-4} 
             & Memory (MB) & 37.17 & 24\% \\ \hline
            \multirow{7}{*}{\begin{tabular}[c]{@{}c@{}}DLTC\\ DTC\end{tabular}} & Total Time (ms) & 10560.6 & 21\% \\ \cline{2-4} 
             & Downtime (ms) & 350.41 & 27\% \\ \cline{2-4} 
             & Total Traffic (MB) & 220.3 & 15\% \\ \cline{2-4} 
             & Throughput (Mbps) & 35.86 & 14\% \\ \cline{2-4} 
             & Performance (\%) & 0.19 & 16\% \\ \cline{2-4} 
             & CPU (\%) & 53.31 & 21\% \\ \cline{2-4} 
             & Memory (MB) & 28.38 & 19\% \\ \hline
            \multirow{7}{*}{THR} & Total Time (ms) & 7251.61 & 13\% \\ \cline{2-4} 
             & Downtime (ms) & 345.85 & 19\% \\ \cline{2-4} 
             & Total Traffic (MB) & 262.66 & 9\% \\ \cline{2-4} 
             & Throughput (Mbps) & 26.74 & 5\% \\ \cline{2-4} 
             & Performance (\%) & 0.17 & 16\% \\ \cline{2-4} 
             & CPU (\%) & 1.58 & 22\% \\ \cline{2-4} 
             & Memory (MB) & 4.5 & 131\% \\ \hline
            \multirow{7}{*}{\begin{tabular}[c]{@{}c@{}}THR \\ POST\end{tabular}} & Total Time (ms) & 6643.13 & 14\% \\ \cline{2-4} 
             & Downtime (ms) & 278.39 & 19\% \\ \cline{2-4} 
             & Total Traffic (MB) & 234.93 & 9\% \\ \cline{2-4} 
             & Throughput (Mbps) & 27.39 & 5\% \\ \cline{2-4} 
             & Performance (\%) & 0.54 & 59\% \\ \cline{2-4} 
             & CPU (\%) & 1.96 & 33\% \\ \cline{2-4} 
             & Memory (MB) & 4.15 & 133\% \\ \hline
            \multirow{7}{*}{\begin{tabular}[c]{@{}c@{}}THR\\ DTC\end{tabular}} & Total Time (ms) & 20403.55 & 29\% \\ \cline{2-4} 
             & Downtime (ms) & 282.32 & 20\% \\ \cline{2-4} 
             & Total Traffic (MB) & 334.08 & 17\% \\ \cline{2-4} 
             & Throughput (Mbps) & 35.64 & 15\% \\ \cline{2-4} 
             & Performance (\%) & 0.18 & 16\% \\ \cline{2-4} 
             & CPU (\%) & 48.85 & 17\% \\ \cline{2-4} 
             & Memory (MB) & 3.25 & 94\% \\ \hline
            \pagebreak
            \multirow{7}{*}{\begin{tabular}[c]{@{}c@{}}THR\\ DLTC\end{tabular}} & Total Time (ms) & 6455.53 & 13\% \\ \cline{2-4} 
             & Downtime (ms) & 358.67 & 23\% \\ \cline{2-4} 
             & Total Traffic (MB) & 237.31 & 9\% \\ \cline{2-4} 
             & Throughput (Mbps) & 27.55 & 5\% \\ \cline{2-4} 
             & Performance (\%) & 0.19 & 20\% \\ \cline{2-4} 
             & CPU (\%) & 1.65 & 22\% \\ \cline{2-4} 
             & Memory (MB) & 20.65 & 14\% \\ \hline
            \multirow{7}{*}{\begin{tabular}[c]{@{}c@{}}THR\\ DLTC\\ POST\end{tabular}} & Total Time (ms) & 6547.87 & 14\% \\ \cline{2-4} 
             & Downtime (ms) & 290.05 & 22\% \\ \cline{2-4} 
             & Total Traffic (MB) & 216.66 & 9\% \\ \cline{2-4} 
             & Throughput (Mbps) & 27.55 & 5\% \\ \cline{2-4} 
             & Performance (\%) & 0.54 & 60\% \\ \cline{2-4} 
             & CPU (\%) & 2.06 & 31\% \\ \cline{2-4} 
             & Memory (MB) & 34.08 & 23\% \\ \hline
            \multirow{7}{*}{\begin{tabular}[c]{@{}c@{}}THR\\ DLTC\\ DTC\end{tabular}} & Total Time (ms) & 11361.65 & 18\% \\ \cline{2-4} 
             & Downtime (ms) & 379.29 & 28\% \\ \cline{2-4} 
             & Total Traffic (MB) & 282.34 & 14\% \\ \cline{2-4} 
             & Throughput & 33.16 & 12\% \\ \cline{2-4} 
             & Performance (\%) & 0.17 & 15\% \\ \cline{2-4} 
             & CPU (\%) & 41.68 & 19\% \\ \cline{2-4} 
             & Memory (MB) & 26.9 & 19\% \\ \hline
             \captionsetup{justification=centering}
             \caption{Accuracy of the different DNN algorithms for the twelve live migration algorithms and the seven target metrics.}
             \label{tab:DNN_results}
        \end{longtabu}
    }

输出:enter image description here

我想要的是:enter image description here

答案1

感谢您的时间,我找到了一种解决方法,即手动设置表格的字体大小:{\fontsize{8}{9}\selectfont TABLE}

相关内容