# LaTeX table: line thickness varying and incorrect horizontal alignment

This LaTeX source ( http://pastebin.com/3HdpbQi5 ) yields two types of errors ( http://i.stack.imgur.com/4J87t.png ):

The line thickness of the table borders in the primary header row varies and the last entry in the secondary header-row ("erh.", short for "erhalten" which means "received" :) is a good few points above where it should be.

Now, knowing that LaTeX does not err, I however do so quite frequently - any ideas what I can do to get a clean result? The whole thing, btw., is a ham radio logbook in case you wondered.

Christian DC1TS.

-

## migrated from stackoverflow.comApr 28 '11 at 0:45

This question came from our site for professional and enthusiast programmers.

a multicolumn should only define the right vertical line {c|}, except for the very first column, there a {|c|} is correct. Otherwise you'll get two vertical lines.

\documentclass[ngerman,12pt,a4paper,oneside,landscape]{article}
\usepackage[utf8]{inputenc}
\usepackage[a4paper, left=0.5cm, right=0.5cm,top=1cm, bottom=0.5cm]{geometry}
\usepackage{babel}
\usepackage[table]{xcolor}
\usepackage{todonotes}
\usepackage{array,ragged2e}
\newcolumntype{M}[1]{>{\Centering}m{#1}}
\begin{document}

\rowcolors{3}{gray!10}{white}
\begin{tabular}{
| m{2cm} %Datum
| m{1.3cm}  %Zeit Start
| m{1.3cm}  %Zeit Ende
| m{2cm}  %Frequenz
| m{1.5cm}  %Mode
| m{3cm}  %Rufzeichen
| m{3cm}  %Name
| m{3cm}  %QTH
| m{1.3cm} %Power
| m{0.9cm} %Report gegeben
| m{0.9cm} %Report erhalten
| m{0.8cm} %QSL gesendet
| m{0.8cm} %QSL erhalten
|}
\hline
Datum &
\multicolumn{2}{c|}{Zeit UTC} &
Frequenz &
Mode &
Rufzeichen &
Name &
QTH &
Power &
\multicolumn{2}{c|}{Report} & \multicolumn{2}{c|}{QSL}  \\ [1ex]
& Start & Ende & (MHz) &  &  & & & (W) & geg. & empf. & ges. & erh. \\ [1ex]
\hline
& : & : & & & & & & & & & & \\ [4ex]\hline
& : & : & & & & & & & & & & \\ [4ex]\hline
& : & : & & & & & & & & & & \\ [4ex]\hline
& : & : & & & & & & & & & & \\ [4ex]\hline
& : & : & & & & & & & & & & \\ [4ex]\hline
& : & : & & & & & & & & & & \\ [4ex]\hline
& : & : & & & & & & & & & & \\ [4ex]\hline
& : & : & & & & & & & & & & \\ [4ex]\hline
& : & : & & & & & & & & & & \\ [4ex]\hline
& : & : & & & & & & & & & & \\ [4ex]\hline
& : & : & & & & & & & & & & \\ [4ex]\hline
& : & : & & & & & & & & & & \\ [4ex]\hline
\end{tabular}

\end{document}

-

I guess the culprits are your strange column specifications. Why not "|c|c|c|c|..."?

Anyway, you can work around the layout problems by omitting the left vertical line of the multicolumns

\multicolumn{2}{c|}{Zeit UTC} &


and putting the last column inside one

\multicolumn{1}{c|}{erh.} \\ [1ex]


But these are just workarounds to fix the layout momentarily, you should try to understand what's going on.

-
I don't use "|c|c|c|..." becaue i need the columns to be of a special width, "|c|c|c|..." would autosize them to the content (which is empty as this is a form to be filled out with a pen). Your answer does do away with the doubled vertical lines! Thanks! – Christian Apr 26 '11 at 5:16
You can solve the second problem by making the last column a p column instead of an m column. – Alan Munn Apr 28 '11 at 4:34