0
\begin{tabularx}{\textwidth}{ |X|X|X| }

    \hline

    \rowcolor{fapsgrau1}\global\setlength\arrayrulewidth{0.4pt}

    \textbf{Länge}          & \textbf{Breite}       & \textbf{Höhe} \\
    \hline
    & 115           & \\
    & 120           & \\
    240 (248)       & 150           & 52 \\
    300 (298) (308) & 175           & 200 \\
    & 200           & 113 (123) \\
    490 (498)       & 240           & 155 \\
    (623)           & 300           & 238 (248) \\
    & 365           & \\
    \hline
\end{tabularx}

How do i need to change the code that the hline on the top is seen and that the lines continue to the top? (cannot upload the picture)

tobias.m
  • 41
  • 1
  • 3

1 Answers1

0

What you're witnessing is an artifact of the PDF viewer, not the LaTeX code. Let's look at a comparison between three PDF viewers:

  1. SumatraPDF
  2. Adobe Acrobat Reader DC
  3. Foxit Reader

Here are different zoom levels for the same table:

  • SumatraPDF @ 150%

    enter image description here

  • Adobe Acrobat Reader DC @ 150%

    enter image description here

  • Foxit Reader @ 150%

    enter image description here

Sumatra shows all the lines around the coloured header, as does Foxit. Adobe Reader doesn't show the top/left rules.


  • SumatraPDF @ 200%

    enter image description here

  • Adobe Acrobat Reader DC @ 200%

    enter image description here

  • Foxit reader @ 200%

    enter image description here

SumatraPDF again shows all rules, while Adobe Reader and Foxit seems to miss the left rule in the header.

As you should be able to see, it's zoom, but also viewer-dependent. Viewers tend to render the output and make it snap to visible pixels. In some of these calculations, there may be rounding that causing visuals to differ from the actual.

Printing will be correct, regardless of the reader.

Werner
  • 14,324
  • 7
  • 55
  • 77