此表未正确显示在中心。我想将其置于中心。请帮助我。
\documentclass{report}
\usepackage{tabularx}
\begin{table}[]
\begin{tabular}{|l|l|l|l|l|l|}
\hline
Resistances & Rated Voltages & Currents & Losses & Input Output Power & Efficeicny \\ \hline
\begin{tabular}[c]{@{}l@{}}Rsh=40 ohm\\ Ra= 10 ohms\end{tabular} &
Vt=88V &
\begin{tabular}[c]{@{}l@{}}It=5A\\ Ish=2.2A\\ Ia=2.8V\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Shunt Field Losses=193.6W\\ Armature Losses=78.4W\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Pin=440W\\ Pout=168W\end{tabular} &
38.18\% \\ \hline
\begin{tabular}[c]{@{}l@{}}Rsh=40ohms\\ Ra= 10 ohms\end{tabular} &
Vt=88V &
\begin{tabular}[c]{@{}l@{}}It=7A\\ Ish=2.2A\\ Ia=4.8A\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Shunt Field Losses=193.6W\\ Armature Losses=230.4W\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Pin=616W\\ Pout=192W\end{tabular} &
31.16\% \\ \hline
\begin{tabular}[c]{@{}l@{}}Rsh=40ohms\\ Ra= 10 ohms\end{tabular} &
Vt=88V &
\begin{tabular}[c]{@{}l@{}}It=9A\\ Ish=2.2A\\ Ia=6.8A\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Shunt Field Losses=193.6W\\ Armature Losses=468.4W\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Pin=792W\\ Pout=130W\end{tabular} &
16.4 \\ \hline
\begin{tabular}[c]{@{}l@{}}Rsh=40 ohms\\ Ra= 10 ohms\end{tabular} &
Vt=88V &
\begin{tabular}[c]{@{}l@{}}It=10A\\ Ish=2.2A\\ Ia=7.8A\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Shunt Field Losses=193.6W\\ Armature Losses=608.4W\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Pin=880W\\ Pout=78.4W\end{tabular} &
8.9\% \\ \hline
\end{tabular}
\end{table}
答案1
主要问题是信息冗余重复。
\documentclass{report}
\usepackage{siunitx}
\usepackage{booktabs}
\newcommand{\splitcell}[2][c]{\begin{tabular}[t]{@{}#1@{}}#2\end{tabular}}
\begin{document}
\begin{table}[htp]
\centering
\setlength{\tabcolsep}{0pt}
\begin{tabular*}{\textwidth}{
@{\extracolsep{\fill}}
S[table-format=2.0]
S[table-format=2.0]
S[table-format=2.0]
S[table-format=2.0]
S[table-format=1.1]
S[table-format=1.1]
S[table-format=3.1]
S[table-format=3.1]
S[table-format=3.0]
S[table-format=3.1]
S[table-format=2.2]
@{}
}
\toprule
\multicolumn{2}{c}{Resistances} &
\multicolumn{1}{c}{\splitcell{Rated \\ Voltages}} &
\multicolumn{3}{c}{Currents} &
\multicolumn{2}{c}{Losses} &
\multicolumn{2}{c}{\splitcell{Input Output \\ Power}} &
\multicolumn{1}{c}{Efficiency} \\
\multicolumn{2}{c}{(\si{\ohm})} &
\multicolumn{1}{c}{(\si{\volt})} &
\multicolumn{3}{c}{(\si{\ampere})} &
\multicolumn{2}{c}{(\si{\watt})} &
\multicolumn{2}{c}{(\si{\watt})} &
\multicolumn{1}{c}{(\%)} \\
\cmidrule{1-2} \cmidrule{3-3} \cmidrule{4-6}
\cmidrule{7-8} \cmidrule{9-10}
{Rsh} & {Ra} & {Vt} & {It} & {Ish} & {Ia} & {SFL} & {AL} & {Pin} & {Pout} & \\
\midrule
40 & 10 & 88 & 5 & 2.2 & 2.8 & 193.6 & 78.4 & 440 & 168 & 38.18 \\
40 & 10 & 88 & 7 & 2.2 & 4.8 & 193.6 & 230.4 & 616 & 192 & 31.16 \\
40 & 10 & 88 & 9 & 2.2 & 6.8 & 193.6 & 468.4 & 792 & 130 & 16.4 \\
40 & 10 & 88 & 10 & 2.2 & 7.8 & 193.6 & 608.4 & 880 & 78.4 & 8.9 \\
\midrule[\heavyrulewidth]
\multicolumn{11}{@{}l@{}}{SFL: Shunt field losses; AL: Armature losses}
\end{tabular*}
\end{table}
\end{document}
答案2
(1)更改左边距,使表格适合页面
(2)借助包使用两行标题makecell
。
作为附加奖励,与您的问题无关,垂直扩展单元格。
(3)建议:使用包siunitx
以一致的方式并按照标准插入单元。我只做了第一行。
\documentclass{report}
\usepackage[left=2.00cm]{geometry} % set margins
\usepackage{makecell}
\usepackage{showframe} %show the margins
\renewcommand\theadalign{cc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[6pt]}
\renewcommand\cellgape{\Gape[4pt]}
\usepackage{siunitx} % proper units
\begin{document}
\begin{table}[]
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\thead{Resistances} & \thead{Rated \\ Voltages} & \thead{Currents} & \thead{Losses} & \thead{Input Output\\ Power} & \thead{Efficiency} \\ \hline
\begin{tabular}[c]{@{}l@{}}Rsh=\SI{40}{\ohm}\\ Ra=\SI{10}{\ohm}\end{tabular} &
Vt=\SI{88}{\volt} &
\begin{tabular}[c]{@{}l@{}}It=\SI{5}{\ampere}\\ Ish=\SI{2.2}{\ampere}\\ Ia=\SI{2.8}{\ampere}\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Shunt Field Losses=\SI{193.6}{\watt}\\ Armature Losses= \SI{78.4}{\watt}\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Pin=\SI{440}{\watt}\\ Pout=\SI{168}{\watt}\end{tabular} &
38.18\% \\ \hline
\begin{tabular}[c]{@{}l@{}}Rsh=40 ohms\\ Ra= 10 ohms\end{tabular} &
Vt=88V &
\begin{tabular}[c]{@{}l@{}}It=7A\\ Ish=2.2A\\ Ia=4.8A\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Shunt Field Losses=193.6W\\ Armature Losses=230.4W\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Pin=616W\\ Pout=192W\end{tabular} &
31.16\% \\ \hline
\begin{tabular}[c]{@{}l@{}}Rsh=40 ohms\\ Ra= 10 ohms\end{tabular} &
Vt=88V &
\begin{tabular}[c]{@{}l@{}}It=9A\\ Ish=2.2A\\ Ia=6.8A\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Shunt Field Losses=193.6W\\ Armature Losses=468.4W\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Pin=792W\\ Pout=130W\end{tabular} &
16.40\% \\ \hline
\begin{tabular}[c]{@{}l@{}}Rsh=40 ohms\\ Ra= 10 ohms\end{tabular} &
Vt=88V &
\begin{tabular}[c]{@{}l@{}}It=10A\\ Ish=2.2A\\ Ia=7.8A\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Shunt Field Losses=193.6W\\ Armature Losses=608.4W\end{tabular} &
\begin{tabular}[c]{@{}l@{}}Pin=880W\\ Pout=78.4W\end{tabular} &
8.90\% \\ \hline
\end{tabular}
\end{table}
\end{document}