![表格水平线不完整](https://linux22.com/image/419481/%E8%A1%A8%E6%A0%BC%E6%B0%B4%E5%B9%B3%E7%BA%BF%E4%B8%8D%E5%AE%8C%E6%95%B4.png)
我有点不明白这个表格生成的结果,似乎水平线渲染不完整。有什么想法可能导致这种情况吗?谢谢。
{\renewcommand{\arraystretch}{1.5}%
\begin{table}[]
\centering
\scriptsize
\begin{tabularx}{\linewidth}{|>{\centering\arraybackslash}m{.6cm}|>{\centering\arraybackslash}m{1.4cm}|>{\centering\arraybackslash}m{1.8cm}|>{\centering\arraybackslash}m{1.3cm}|c|c|c|c|c|c|>{\centering\arraybackslash}m{.6cm}|c|}
\hline
& \multicolumn{3}{c|}{\textbf{INPUTS}} & \multicolumn{8}{c|}{\textbf{OUTPUTS}}\\ \hline
& V1 & V2 & V3 & V1 & I1 & V2 & I2 & V3 & I3 & V4 & I4 \\ \hline
PS 1 & 200V AC, 400 Hz & 115V AC, 400 Hz & - & +5V & 1A & +15V & 1.5A & -15V & 1.5A & - & - \\ \hline
PS 2 & - & 115V AC, 50-400 Hz (3 Phase) & 200-300V DC & - & - & - & - & - & - & +96V & 0.2A \\ \hline
PS 3 & 220V AC, 50-400 Hz (1 Phase) & 115V AC, 50-400 Hz (1,2 \& 3 Phase) & 200-300V DC & +5V & 50A & - & - & - & - & - & - \\ \hline
PS 4 & - & - & 28V DC $\pm$ 12V & - & - & +15V & 3.5A & -15V & 3.5A & 26V AC, 400Hz & 3A \\ \hline
PS 5 & 220V AC, 50-400 Hz (1 Phase) & 115V AC, 50-400 Hz (1,2 \& 3 Phase) & 200-300V DC & - & - & +15V & 3.5A & -15V & 3.5A & - & - \\ \hline
\end{tabularx}
\end{table}}
答案1
(红线表示文本边框)
- 你没有在文档中提供任何有关页面布局的信息,所以我们只能猜测
- 在上表中,假设页面布局由
geometry
包的默认值定义 - 使用
tabularx
表环境要求至少有一列必须是X
或从其派生的类型:
\documentclass{article}
\usepackage{geometry}
\usepackage{tabularx}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
\newcolumntype{C}{>{\centering\arraybackslash}X}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{table}
\centering
\footnotesize
\renewcommand{\arraystretch}{1.5}
\setlength\tabcolsep{3pt}
\begin{tabularx}{\linewidth}{|M{7mm}|
M{13mm}|
M{25mm}|
M{13mm}|
C|C|C|C|C|C|M{12mm}|C|}
\hline
& \multicolumn{3}{c|}{\textbf{INPUTS}} & \multicolumn{8}{c|}{\textbf{OUTPUTS}}\\ \hline
& V1 & V2 & V3 & V1 & I1 & V2 & I2 & V3 & I3 & V4 & I4 \\ \hline
PS 1 & 200V AC, 400 Hz & 115V AC, 400 Hz & - & +5V & 1A & +15V & 1.5A & $-15$V & 1.5A & - & - \\ \hline
PS 2 & - & 115V AC, 50-400 Hz (3 Phase) & 200-300V DC & - & - & - & - & - & - & +96V & 0.2A \\ \hline
PS 3 & 220V AC, 50-400 Hz (1 Phase) & 115V AC, 50-400 Hz (1,2 \& 3 Phase) & 200-300V DC & +5V & 50A & - & - & - & - & - & - \\ \hline
PS 4 & - & - & 28V DC $\pm$ 12V & - & - & +15V & 3.5A & $-15$V & 3.5A & 26V AC, 400Hz & 3A \\ \hline
PS 5 & 220V AC, 50-400 Hz (1 Phase) & 115V AC, 50-400 Hz (1,2 \& 3 Phase) & 200-300V DC & - & - & +15V & 3.5A & $-15$V & 3.5A & - & - \\ \hline
\end{tabularx}
\end{table}
\end{document}