I have this longtable
table, where I want to locate two multicolumn
s after each other. When I compile with the second multicolumn
commented out, everything is fine (pic 1). But with two consecutive multicolumn
s the width of the table is completely changed (pic 2). What's happening?
My question might be a duplicate of Multicolumn width in longtable, but I don't see how the solution can be used in my problem...
MWE:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{fouriernc}
\usepackage{tabularx,booktabs,parskip}
\usepackage[text={9in,6in},showframe,landscape]{geometry}
\usepackage{setspace,url,multirow,longtable,array}
\usepackage{enumitem}
\setlist{nolistsep}
\renewcommand\labelitemi{--}
\newcolumntype{P}[1]{>{\raggedright}p{\dimexpr#1\textwidth-2\tabcolsep}}
\begin{document}
\begin{longtable}{P{0.05} P{0.05} P{0.3} P{0.3} P{0.15} P{0.15}}
\toprule
\multicolumn{2}{l}{Tema: } & \multicolumn{4}{l}{Geometri} \tabularnewline
% \multicolumn{2}{l}{Kompetansemål i K06: } & \multicolumn{4}{l}{Some text} \tabularnewline
\midrule
Uke & Time & Læringsmål for timen & Arbeidsmetoder & Uformell vurdering & Kjerneord/ begreper \tabularnewline
\midrule
\endfirsthead
%
\multicolumn{3}{c}%
{{\bfseries \tablename\ \thetable{} -- fortsatt fra forrige side}} \tabularnewline
\midrule Uke & Time & Læringsmål for timen & Arbeidsmetoder & Uformell vurdering & Kjerneord/begreper \tabularnewline \midrule
\endhead
%
\midrule \multicolumn{3}{|r|}{{Fortsetter på neste side}} \tabularnewline \midrule
\endfoot
%
\bottomrule
\endlastfoot
46 & 1 & Some stuff & Some more stuff & Utsjekk. & Katet, hypotenus, kvadrat
\tabularnewline
\bottomrule
\end{longtable}
\end{document}
Producing
While without commenting out the second multicolumn
the table is way outside the page borders: