简体   繁体   中英

Latex - Uncomplete vertical line on tabular

I'm trying to make a bit tricky table in Latex using tabular, I wrote the following code :

\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.

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}

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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