表格行的问题

表格行的问题

我遇到了此处所附表格最后一行的问题。 在此处输入图片描述

我希望三列的宽度相等。我该怎么做?下面是我使用的代码:

\begin{table}[]
\centering
\begin{tabular}{|l|l|c|l|c|l|}
\hline
\multicolumn{3}{|c|}{\multirow{2}{*}{${k_p}^2 = \frac{{f_{DH}}^2 - {f_{EH}}^2}{{f_{DH}}^2}$}}                                                          & \multicolumn{3}{c|}{\multirow{2}{*}{${k_{em}}^2 = \frac{{f_{EB}}^2 - {f_{EH}}^2}{{f_{EB}}^2}$}}                                                        \\
\multicolumn{3}{|c|}{}                                                                                                                                 & \multicolumn{3}{c|}{}                                                                                                                                  \\ \hline
\multicolumn{3}{|l|}{\multirow{2}{*}{$K_{DH} = \frac{\alpha^2}{C_0}\frac{{f_{DH}}^2}{{f_{DH}}^2-{f_{EH}}^2} = \frac{\alpha^2}{C_0}\frac{1}{{k_p}^2}$}} & \multicolumn{3}{l|}{\multirow{2}{*}{$K_{EB} = \frac{\beta^2}{L_0}\frac{{f_{EB}}^2}{{f_{EB}}^2-{f_{EH}}^2} = \frac{\beta^2}{L_0}\frac{1}{{k_{em}}^2}$}} \\
\multicolumn{3}{|l|}{}                                                                                                                                 & \multicolumn{3}{l|}{}                                                                                                                                  \\ \hline
\multicolumn{3}{|l|}{\multirow{2}{*}{$K_{EH} = K_{DH} - \frac{\alpha^2}{C_0}$}}                                                                        & \multicolumn{3}{l|}{\multirow{2}{*}{$K_{DB} = K_{EB} - \frac{\beta^2}{L_0}$}}                                                                          \\
\multicolumn{3}{|l|}{}                                                                                                                                 & \multicolumn{3}{l|}{}                                                                                                                                  \\ \hline
\multicolumn{2}{|c|}{\multirow{2}{*}{$M = \frac{K_{EH}}{{\omega_{EH}}^2}$}}                         & \multicolumn{2}{c|}{\multirow{2}{*}{$C = \frac{M\omega_{DH}}{Q_m}$}}                                 & \multicolumn{2}{c|}{\multirow{2}{*}{$Q_m = \frac{f_0}{f_2 - f_1}$}}                                \\
\multicolumn{2}{|c|}{}                                                                              & \multicolumn{2}{c|}{}                                                                                & \multicolumn{2}{c|}{}                                                                              \\ \hline
\end{tabular}
\end{table}

答案1

这是一个tabularx基于 的解决方案,可让您摆脱每一个包装\multicolumn\multirow。它还致力于通过摆脱所有垂直线和大多数水平线来创建更开放的“外观”。

两种环境的宽度tabularx都设置为\textwidth。第一个tabularx环境包含 2 个居中的 X 型列,用于前三行。第二个tabularx环境包含 3 个居中的 X 型列,仅适用于最后一行。

在此处输入图片描述

\documentclass{article}
\usepackage{booktabs,tabularx}
\newcommand\vn[1]{\mathit{#1}} % how to display variable names
\newcolumntype{C}{>{\centering\arraybackslash$\displaystyle }X<{$}}
\begin{document}
\begin{table}
\begin{tabularx}{\textwidth}{@{} CC @{}}
\toprule
k_p^2 = \frac{{f_{\vn{DH}}}^2 - {f_{\vn{EH}}}^2}{{f_{\vn{DH}}}^2} & 
k_{em}^2 = \frac{{f_{\vn{EB}}}^2 - {f_{\vn{EH}}}^2}{{f_{\vn{EB}}}^2} \\ 
\addlinespace
K_{\vn{DH}} = 
      \frac{\alpha^2}{C^{}_0}\frac{{f_{\vn{DH}}}^2}{{f_{\vn{DH}}}^2-{f_{\vn{EH}}}^2} = 
      \frac{\alpha^2}{C^{}_0}\frac{1}{{k_p}^2} & 
K_{\vn{EB}} = 
      \frac{\beta^2}{L^{}_0}\frac{{f_{\vn{EB}}}^2}{{f_{\vn{EB}}}^2-{f_{\vn{EH}}}^2} = 
      \frac{\beta^2}{L^{}_0}\frac{1}{{k_{em}}^2}\\ 
\addlinespace
K_{\vn{EH}} = K_{\vn{DH}} - \frac{\alpha^2}{C^{}_0} & 
K_{\vn{DB}} = K_{\vn{EB}} - \frac{\beta^2}{L^{}_0} \\
\addlinespace
\end{tabularx}
\begin{tabularx}{\textwidth}{@{} CCC @{}}
M   = \frac{K_{\vn{EH}}}{{\omega_{\vn{EH}}}^2} & 
C   = \frac{M\omega_{\vn{DH}}}{Q_m} & 
Q_m = \frac{f^{}_0}{f_2 - f_1} \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}

附录:仅仅为了完整性,这里是第二种解决方案,它将第二行和第三行的内容左对齐。

在此处输入图片描述

\documentclass{article}
\usepackage{booktabs,tabularx}
\newcommand\vn[1]{\mathit{#1}} % how to display variable names
\newcolumntype{C}{>{\centering\arraybackslash$\displaystyle}X<{$}}
\newcolumntype{L}{>{\raggedright\arraybackslash$\displaystyle}X<{$}}
\begin{document}

\begin{table}
\begin{tabularx}{\textwidth}{@{} CC @{}}
\toprule
k_p^2 = \frac{{f_{\vn{DH}}}^2 - {f_{\vn{EH}}}^2}{{f_{\vn{DH}}}^2} & 
k_{em}^2 = \frac{{f_{\vn{EB}}}^2 - {f_{\vn{EH}}}^2}{{f_{\vn{EB}}}^2} \\ 
\addlinespace
\end{tabularx}
\begin{tabularx}{\textwidth}{@{} LL @{}}
K_{\vn{DH}} = 
      \frac{\alpha^2}{C^{}_0} \frac{{f_{\vn{DH}}}^2}{{f_{\vn{DH}}}^2-{f_{\vn{EH}}}^2} = 
      \frac{\alpha^2}{C^{}_0} \frac{1}{{k_p}^2} & 
K_{\vn{EB}} = 
      \frac{\beta^2}{L^{}_0} \frac{{f_{\vn{EB}}}^2}{{f_{\vn{EB}}}^2-{f_{\vn{EH}}}^2} = 
      \frac{\beta^2}{L^{}_0} \frac{1}{{k_{em}}^2} \\ 
\addlinespace
K_{\vn{EH}} = K_{\vn{DH}} - \frac{\alpha^2}{C_0} & 
K_{\vn{DB}} = K_{\vn{EB}} - \frac{\beta^2}{L_0} \\
\addlinespace
\end{tabularx}
\begin{tabularx}{\textwidth}{@{} CCC @{}}
M   = \frac{K_{\vn{EH}}}{{\omega_{\vn{EH}}}^2} & 
C   = \frac{M\omega_{\vn{DH}}}{Q_m} & 
Q_m = \frac{f^{}_0}{f_2 - f_1} \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}

相关内容