0

I could not find a solution for the following problem. That's why I address my problem now here.

I want to design a table without fancy libraries, just with some basic features like \hline and spacing commands. But this strategy does not lead me on the right way.

I attached a picture of the compiled latex code. You can see small white gaps in the vertical lines. How do I get rid of those? It is supposed to be a continuous line.

\begin{table}[ht]
\centering
\caption[bla]{bla }
\begin{tabular}{| p{1.8cm} | p{3cm} | p{4.7cm} | p{3.5cm} |}
    \hline \\[-1.0em]
    bla     & bla & bla & bla \\
    \hline \hline \\[-1.0em]
    bla & bla  & bla & bla \\
    \hline \\[-1.0em]
    bla & bla & bla  & bla \\
    \hline \\[-1.0em]
    bla & bla & bla &bla\\
    \hline \\[-1.0em]
    bla & bla &bla Jahre &  bla \\
    \hline \\[-1.0em]
    bla &bla   & bla &bla \\
    \hline
\end{tabular}%
\label{tab:bF}%
\end{table}%

compiledResult

Thanks a lot for your support!

3 Answers3

2

Don't make a second line break after the \hline.

\documentclass{article}

\begin{document}
\begin{table}[ht]
    \centering
    \caption[bla]{bla }
    \begin{tabular}{| p{1.8cm} | p{3cm} | p{4.7cm} | p{3.5cm} |}
        \hline
        bla     & bla & bla & bla \\
        \hline \hline
        bla & bla  & bla & bla \\
        \hline
        bla & bla & bla  & bla \\
        \hline
        bla & bla & bla &bla\\
        \hline
        bla & bla &bla Jahre &  bla \\
        \hline
        bla &bla   & bla &bla \\
        \hline
    \end{tabular}%
    \label{tab:bF}%
\end{table}%
\end{document}

enter image description here

dexteritas
  • 9,161
2

When you add an empty line the vrules of empty, unused cell disappear. So don't write \\[-1em] but &&&\\[-1em]:

\documentclass{article}

\begin{document}

\begin{tabular}{| p{1.8cm} | p{3cm} | p{4.7cm} | p{3.5cm} |}
    \hline 
    &&&\\ %line with cells
    bla     & bla & bla & bla \\
    \hline 
       \\ %empty line gives missing vlines
    bla & bla  & bla & bla \\
\end{tabular}%
\end{document}

enter image description here

Ulrike Fischer
  • 327,261
  • It explains your problem, but I have some doubts that you really need all this additional lines. Load better the array package and change \extrarowheight. – Ulrike Fischer Aug 02 '17 at 11:48
0

Try with this code:

\documentclass{article}
\usepackage{multirow,array,booktabs}

\begin{document}

\begin{table}
\centering
\caption {text} \label{tab:lb3}
\begin{tabular}
    {!{\vrule width 0.2em}c|*4{c|c|c|c!{\vrule width 0.2em}}}
    \specialrule{0.2em}{0em}{0em}
    1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
    \specialrule{0.2em}{0em}{0em}
    0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & \multicolumn{3}{c@{~\setlength{\arrayrulewidth}{0.2em}\vline}}{\multirow{3}*{A}} \\
    \cline {1-10}
    0 & 0 & 0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & \multicolumn{3}{c@{~\setlength{\arrayrulewidth}{0.2em}\vline}}{} \\
    \cline{1-9}
    0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & \multicolumn{3}{c@{~\setlength{\arrayrulewidth}{0.2em}\vline}}{} \\
    \specialrule{0.2em}{0em}{0em}
\end{tabular}
\end{table}

\end{document}
MadyYuvi
  • 13,693