1

I am having some problems writing the following table:

\begin{table}[h!]
\centering
\scriptsize
\begin{tabular}{|c| c |c| c| c| c| c| c| c |}
\hline
Denominación  & \multicolumn{3}{c}{Dimensiones} & \multicolumn{2}{c}{Fibras} & \multicolumn{3}{c}{Refuerzo convencional}  \\[-0pt]\cline{2-4} \cline{5-6} \cline{7-9}
 de probeta & Largo  & Ancho  & Espesor  & Nombre & Dosis & Malla  & Malla  & Marco\\[-0pt]
 & (cm) & (cm) & (cm) &  &  &  superior &  inferior & Reticulado\\[-0pt]
\midrule
A1 & \multirow{8}{*}{150} & \multirow{12}{*}{50} & \multirow{12}{*}{15}  & \multirow{4}{*}{----}  & \multirow{4}{*}{----} & \multirow{12}{*}{ACMA C139} & \multirow{4}{*}{ACMA C139}  & \multirow{2}{*}{----} \\[-0pt]
A2 &  &  &  &  &  &  &  & \\[-0pt]
B1 &  &  &  &  &  &  &  & \multirow{10}{*}{$1\phi 12+2\phi10$}\\[-0pt]\cline{9-9}
B2 &  &  &  &  &  &  &  & \\[-0pt]\cline{5-5}\cline{6-6}\cline{8-8}
CA1 &  &  &  & \multirow{1}{*}{DRAMIX 3D}  &  \multirow{2}{*}{35 kg/m3}  &  & \multirow{8}{*}{----} & \\[-0pt]
CA2 &  &  &  &  65/35 BG &  &  &  & \\[-0pt]\cline{5-5}\cline{6-6}
CP1 &  &  &  & \multirow{1}{*}{EPC BarChip} & \multirow{2}{*}{6 kg/m3} &  &  & \\[-0pt]
CP2 &  &  &  &  48  &  &  &  & \\[-0pt]\cline{2-2}\cline{5-5}\cline{6-6}
DA1 & \multirow{4}{*}{80} &  &  & \multirow{1}{*}{DRAMIX 3D} & \multirow{2}{*}{35 kg/m3} &  &  & \\[-0pt]
DA2 &  &  &  & 65/35 BG &  &  &  & \\[-0pt]\cline{5-5}\cline{6-6}
DP1 &  &  &  & \multirow{1}{*}{EPC BarChip} & \multirow{2}{*}{6 kg/m3} &  &  & \\[-0pt]
DP2 &  &  &  &  48  &  &  &  & \\[-0pt]
\bottomrule
\end{tabular}
\caption{Especificaciones generales de las probetas a ensayar}
\label{tab:dimnesn}
\end{table}

As you can see, vertical lines do not appear in the upper part, and some vertical lines are not connected with the horizontal ones.

enter image description here

I still don't understand what is wrong with my code. Regards.

4
  • You use booktabs rules. They are not intended for use with vertical lines (packages assume, that use of vertical lines gives ugly result). Replace \midrule and \bottomrule with \hline, and discontinuity will disappear. And multicolumn erase vertical lines, sou yoou need ad in it as for example \multicolumn{3}{c|}{Dimensiones}. Of course it will be fare more better not to use vertical lines at all ...
    – Zarko
    Nov 13 '15 at 18:11
  • From the booktabs documentation (section 2 The layout of formal tables): "You will not go far wrong if you remember two simple guidelines at all times: 1. Never, ever use vertical rules. 2. Never use double rules". By way of example, section 1 Introduction is just as illustrative. Read it. Read all of it.
    – Werner
    Nov 13 '15 at 18:23
  • I'm well aware that vertical lines are ugly, but in this particular case I don't see how to properly display the table without them. Guidance will be greatly appreciated.
    – Francisco
    Nov 13 '15 at 18:26
  • Well, if you want to use vertical lines, then don't use booktabs and do the necessary changes as suggested by Zarko.
    – jarauh
    Nov 13 '15 at 19:03
2

See which one is better suited for your needs:

enter image description here

For both tables I use your MWE, in which I omit all redundancies (as [0pt] after each end row), with packages makecell I try to improve look-out of column headers ...

\documentclass{article}
    \usepackage{array,booktabs,makecell,multirow}
    \usepackage{siunitx}
    \usepackage[margin=25mm,a4paper]{geometry}

    \begin{document}
%---------------------------------------------------------------%
\begin{table}[h!]
    \centering
    \footnotesize
\begin{tabular}{@{}*{9}{c}@{}}
    \toprule
\multirowcell{4}{Denominación\\ de probeta}  
    &   \multicolumn{3}{c}{Dimensiones} 
        &   \multicolumn{2}{c}{Fibras} 
            &   \multicolumn{3}{c}{Refuerzo convencional}           \\
    \cmidrule(lr){2-4}\cmidrule(lr){5-6}\cmidrule(l){7-9}
    &   \thead{Largo\\(cm)}
        &   \thead{Ancho\\(cm)}  
            &   \thead{Espesor\\(cm)}  
                &   Nombre  &   Dosis   
                    &   \thead{Malla\\ superior}  
                        &   \thead{Malla\\ inferior}   
                            &   \thead{Marco\\ Reticulado}          \\
    \midrule
A1  &   \multirowcell{8}{$\vdots$\\150\\$\vdots$} 
        &   \multirowcell{12}{$\vdots$\\50\\$\vdots$} 
            &   \multirowcell{12}{$\vdots$\\15\\$\vdots$}  
                &   \multirowcell{4}{---}  
                    &   \multirowcell{4}{---} 
                        &   \multirowcell{12}{ACMA C139} 
                            &   \multirowcell{4}{ACMA C139}  
                                &   \multirowcell{2}{---}           \\
A2 &    &   &   &   &   &   &   &                                   \\
B1 &    &   &   &   &   &   &   &   \multirowcell{10}{$\vdots$\\
                                                      $1\phi 12+2\phi10$\\
                                                      $\vdots$}     \\
    \cmidrule{9-9}
B2 &    &   &   &   &   &   &   & \\
    \cmidrule{5-5}\cmidrule{6-6}\cmidrule{8-8}
CA1&    &   &   &   \multirowcell{1}{DRAMIX 3D}  
                    &   \multirowcell{2}{\SI{35}{kg/m3}}  
                        &   &   \multirowcell{8}{---}   &           \\
CA2&    &   &   &   65/35 BG 
                    &   &   &   &                                   \\
    \cmidrule{5-5}\cmidrule{6-6}
CP1&    &   &   &   \multirowcell{1}{*}{EPC BarChip} 
                    &   \multirowcell{2}{\SI{6}{kg/m3}}
                        &   &   &                                   \\
CP2&    &   &   &   48  
                    &   &   &   &                                   \\
    \cmidrule{2-2}\cmidrule{5-5}\cmidrule{6-6}
DA1&    \multirowcell{4}{$\vdots$\\80\\$\vdots$} 
        &   &   &   \multirowcell{1}{DRAMIX 3D} 
                    &   \multirowcell{2}{\SI{35}{ kg/m3}} 
                        &   &   &                                   \\
DA2&    &   &   &   65/35 BG 
                    &   &   &   &                                   \\
    \cmidrule{5-5}\cmidrule{6-6}
DP1&    &   &   &   \multirowcell{1}{EPC BarChip} 
                    &   \multirowcell{2}{\SI{6}{kg/m3}}
                        &   &   &                                   \\
DP2&    &   &   &   48  
                    &   &   &   &                                   \\
    \bottomrule
\end{tabular}
    \caption{Especificaciones generales de las probetas a ensayar}
    \label{tab:dimnesn}
\end{table}

\begin{table}[h!]
    \centering
    \small
    \setlength{\tabcolsep}{4pt}
\begin{tabular}{|*{9}{c|}}
    \hline
\multirowcell{4}{Denominación\\ de probeta}
    &   \multicolumn{3}{c|}{Dimensiones}
        &   \multicolumn{2}{c|}{Fibras}
            &   \multicolumn{3}{c|}{Refuerzo convencional}           \\
    \cline{2-9}
    &   \thead{Largo\\(cm)}
        &   \thead{Ancho\\(cm)}
            &   \thead{Espesor\\(cm)}
                &   Nombre  &   Dosis
                    &   \thead{Malla\\ superior}
                        &   \thead{Malla\\ inferior}
                            &   \thead{Marco\\ Reticulado}          \\
    \hline
A1  &   \multirowcell{8}{$\vdots$\\150\\$\vdots$}
        &   \multirowcell{12}{$\vdots$\\50\\$\vdots$}
            &   \multirowcell{12}{$\vdots$\\15\\$\vdots$}
                &   \multirowcell{4}{---}
                    &   \multirowcell{4}{---}
                        &   \multirowcell{12}{ACMA C139}
                            &   \multirowcell{4}{ACMA C139}
                                &   \multirowcell{2}{---}           \\
A2 &    &   &   &   &   &   &   &                                   \\
B1 &    &   &   &   &   &   &   &   \multirowcell{10}{$\vdots$\\
                                                      $1\phi 12+2\phi10$\\
                                                      $\vdots$}     \\
    \cline{9-9}
B2 &    &   &   &   &   &   &   & \\
    \cline{5-6}\cline{8-8}
CA1&    &   &   &   \multirowcell{1}{DRAMIX 3D}
                    &   \multirowcell{2}{\SI{35}{kg/m3}}
                        &   &   \multirowcell{8}{---}   &           \\
CA2&    &   &   &   65/35 BG
                    &   &   &   &                                   \\
    \cline{5-6}
CP1&    &   &   &   \multirowcell{1}{*}{EPC BarChip}
                    &   \multirowcell{2}{\SI{6}{kg/m3}}
                        &   &   &                                   \\
CP2&    &   &   &   48
                    &   &   &   &                                   \\
    \cline{2-2}\cline{5-6}
DA1&    \multirowcell{4}{$\vdots$\\80\\$\vdots$}
        &   &   &   \multirowcell{1}{DRAMIX 3D}
                    &   \multirowcell{2}{\SI{35}{ kg/m3}}
                        &   &   &                                   \\
DA2&    &   &   &   65/35 BG
                    &   &   &   &                                   \\
    \cline{5-6}
DP1&    &   &   &   \multirowcell{1}{EPC BarChip}
                    &   \multirowcell{2}{\SI{6}{kg/m3}}
                        &   &   &                                   \\
DP2&    &   &   &   48
                    &   &   &   &                                   \\
    \hline
\end{tabular}
    \caption{Especificaciones generales de las probetas a ensayar}
    \label{tab:dimnesn}
\end{table}
%---------------------------------------------------------------%
    \end{document}
0
1

I propose this, using makecell (for line breaks in cells) and siunitx, and reducing the value of \tabcolsep:

\documentclass{article}
\usepackage[utf8]{inputenc} 
\usepackage{array}
\usepackage{makecell, multirow, booktabs}
\usepackage{siunitx} 
\renewcommand\theadfont{\bfseries}
\renewcommand\cellalign{cc}

\usepackage{cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}

\begin{document}

\begin{table}[h!]
\centering\setlength\tabcolsep{5pt}
\scriptsize
\begin{tabular}{@{}*{9}{c}@{}}
\toprule
& \multicolumn{3}{c}{Dimensiones} & \multicolumn{2}{c}{Fibras} & \multicolumn{3}{c}{Refuerzo convencional} \\ \cmidrule(lr){2-4}\cmidrule(lr){5-6}\cmidrule(lr){7-9}
\makecell{Denominación\\ de probeta } & \makecell{Largo\\cm} & \makecell{Ancho\\(cm)} & \makecell{Espesor\\(cm)} & Nombre & Dosis & \makecell{Malla\\superior} & \makecell{Malla\\ inferior} & \makecell{Marco\\ Reticulado}\\
\midrule
A1 &
 & & & \multirowcell{4}{---} & \multirowcell{4}{---} & & \multirowcell{4}[-1em]{ACMA C139} & \multirowcell{4}{---} \\
\addlinespace
A2 \\
\addlinespace
B1 & & & & & & & & \\
\cmidrule{9-9}
B2 & \multirowcell{2}{150}\\
\cmidrule{5-6}\cmidrule{8-8}
\makecell{CA1\\ CA2}& & \multirowcell{3}{50} & \multirowcell{3}{15} & \makecell{DRAMIX 3D\\65/35 BG} & \SI{35}{kg\per m\cubed} &\multirowcell{3}{ACMA C139} & \multirow{8}{*}{---} & \\
\cmidrule{5-6}
\makecell{CP1\\CP2} & & & & \makecell{EPC BarChip\\48} & \SI{6}{kg\per m\cubed} & & & $1\phi 12+2\phi10$ \\
\cmidrule{2-2}\cmidrule{5-6}
\makecell{DA1\\DA2} & \multirow{4}{*}{80} & & & \makecell{DRAMIX 3D\\65/35 BG} & \SI{35}{kg\per m\cubed} & & & \\
\cmidrule{5-6}
\makecell{DP1\\DP2} & & & & \makecell{EPC BarChip\\48} & \SI{6}{kg\per m\cubed} & & & \\
\bottomrule
\end{tabular}
\caption{Especificaciones generales de las probetas a ensayar}
\label{tab:dimnesn}
\end{table}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.