简体   繁体   English

Latex - 表格上不完整的垂直线

[英]Latex - Uncomplete vertical line on tabular

I'm trying to make a bit tricky table in Latex using tabular, I wrote the following code :我正在尝试使用表格在 Latex 中制作一个有点棘手的表格,我编写了以下代码:

\begin{tabular}{|c|c|c|c|c|}
        \hline
        n° structure & n° hexagone & valeur circuit & $R(K_i)$ & $E(B)$\\
        \hline
        \multirow{3}{*}{$K_1$} & $h_1$ & $R_1$ & \multirow{3}{*}{$2R_1 + R_2 = 1.984$} & \multirow{12}{*}{$\frac{6R_1 + 4R_2 + 2R_3}{4} = 1.5995$}\\
                           & $h_2$ & $R_1$ & \\
                           & $h_3$ & $R_2$ & \\
        \cline{1-4}
        \multirow{3}{*}{$K_2$} & $h_1$ & $R_1$ & \multirow{3}{*}{$R_1 + R_2 + R_3 = 1.215$} \\
                           & $h_2$ & $R_2$ & \\
                           & $h_3$ & $R_3$ & \\
        \cline{1-4}
        \multirow{3}{*}{$K_3$} & $h_1$ & $R_2$ & \multirow{3}{*}{$2R_1 + R_2 = 1.984$} \\
                           & $h_2$ & $R_1$ & \\
                           & $h_3$ & $R_1$ & \\
        \cline{1-4}
        \multirow{3}{*}{$K_4$} & $h_1$ & $R_3$ & \multirow{3}{*}{$R_1 + R_2 + R_3 = 1.215$} \\
                           & $h_2$ & $R_2$ & \\
                           & $h_3$ & $R_1$ & \\
        \hline
    \end{tabular}

And I got the following output, I really don't understand why the last vertical line isn't complete :我得到了以下输出,我真的不明白为什么最后一条垂直线不完整:

在此处输入图像描述

Does someone known the origin of the problem ?有人知道问题的根源吗? Cordialy.亲切地。

Your table would look much more professional if you would not use vertical lines.如果你不使用垂直线,你的桌子看起来会更专业。 See eg the documentation of the booktabs package for more information about creating good looking tables.有关创建美观表格的更多信息,请参见例如booktabs包的文档。

If you insist on vertical lines, you must make sure that each row has the same number of cells:如果您坚持使用垂直线,则必须确保每行具有相同数量的单元格:

\documentclass{article}
\usepackage{multirow}

\begin{document}

\begin{tabular}{|c|c|c|c|c|}
        \hline
        n° structure & n° hexagone & valeur circuit & $R(K_i)$ & $E(B)$\\
        \hline
        \multirow{3}{*}{$K_1$} & $h_1$ & $R_1$ & \multirow{3}{*}{$2R_1 + R_2 = 1.984$} & \multirow{12}{*}{$\frac{6R_1 + 4R_2 + 2R_3}{4} = 1.5995$}\\
                           & $h_2$ & $R_1$ & & \\
                           & $h_3$ & $R_2$ & & \\
        \cline{1-4}
        \multirow{3}{*}{$K_2$} & $h_1$ & $R_1$ & \multirow{3}{*}{$R_1 + R_2 + R_3 = 1.215$}  &\\
                           & $h_2$ & $R_2$ & & \\
                           & $h_3$ & $R_3$ & & \\
        \cline{1-4}
        \multirow{3}{*}{$K_3$} & $h_1$ & $R_2$ & \multirow{3}{*}{$2R_1 + R_2 = 1.984$}  &\\
                           & $h_2$ & $R_1$ & & \\
                           & $h_3$ & $R_1$ & & \\
        \cline{1-4}
        \multirow{3}{*}{$K_4$} & $h_1$ & $R_3$ & \multirow{3}{*}{$R_1 + R_2 + R_3 = 1.215$}  &\\
                           & $h_2$ & $R_2$ & & \\
                           & $h_3$ & $R_1$ & & \\
        \hline
    \end{tabular}

\end{document}

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM