1

I think multicolumn function is overriding my table width. 4th (1.4cm) and 6th (1.8cm) column width is not as configured, it should be 2.3 cm and then table will get connected with page border.

I have tried to remove multicolumn on 4th and 6th column and then table width is 2.3cm but then I dont have vertical lines :(

\begin{tabular}{@{}p{3cm}@{}@{}p{2.95cm}@{}|@{}p{2.3cm}@{}|@{}p{2.3cm}@{}@{}p{2.3cm}@{}|@{}p{2.3cm}@{}@{}p{1.5cm}@{}@{}p{0.8cm}@{}}

enter image description here

my code:

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{array}
\usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{makecell}
\usepackage[export]{adjustbox}
\usepackage{graphbox}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{bigstrut}
\usepackage{graphicx}

\usepackage{geometry}
\geometry{paper=a4paper}
\geometry{bindingoffset=1.5cm,hmargin={1.5cm,1.5cm},vmargin={1cm,1cm},
includehead=false,
includefoot=true,footskip=10cm}

\pagestyle{fancy}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}

\fancyhead[CE,CO,LE,LO,RE,RO]{} %% clear out all headers
\fancyfoot[CE,CO,LE,LO,RE,RO]{} %% clear out all footers
\fancyhf{}                      %% clear default for head and foot
\fancyfoot[C]{%
    \begin{tikzpicture}[remember picture,overlay]
    \node[anchor=south west,inner sep=0pt] at ($(current page.south west)+(2.5cm,1cm)$) {
        \begin{tabular}{@{}p{3cm}@{}@{}p{2.95cm}@{}|@{}p{2.3cm}@{}|@{}p{2.3cm}@{}@{}p{2.3cm}@{}|@{}p{2.3cm}@{}@{}p{1.5cm}@{}@{}p{0.8cm}@{}}
        \cline{3-8}     
        &
        &
        & \multicolumn{1}{c|}{}
        &
        & \multicolumn{1}{c|}{}
        & \multicolumn{2}{c }{}
        \bigstrut\\ \cline{3-8}         
        &
        &
        & \multicolumn{1}{c|}{}
        &
        & \multicolumn{1}{c|}{}
        & \multicolumn{2}{c }{}
        \bigstrut\\ \cline{3-8}         
        &
        &
        & \multicolumn{1}{c|}{}
        &
        & \multicolumn{1}{c|}{}
        & \multicolumn{2}{c }{}
        \bigstrut\\ \cline{3-8}         
        &
        & \centering\textbf{\scriptsize A}
        & \multicolumn{1}{c|}{\textbf{\scriptsize 1}}
        & \centering\textbf{\scriptsize 1}
        & \multicolumn{1}{c|}{\textbf{\scriptsize 1}}
        & \multicolumn{2}{c }{\textbf{\scriptsize 1}}
        \bigstrut\\ \cline{3-8}         
        &
        & \multicolumn{1}{c|}{\scriptsize Rev.:}
        & \multicolumn{1}{c|}{\scriptsize Datum:}
        & \multicolumn{1}{c|}{\scriptsize Gezeichnet:}
        & \multicolumn{1}{c|}{\scriptsize Überprüft:}
        & \multicolumn{2}{c }{\scriptsize Genehmigt:}
        \bigstrut\\ \hline
        \scriptsize Klient:
        & \multicolumn{3}{c}{\includegraphics[valign=c,scale=0.2]{example-image-a}}
        & \multicolumn{3}{l}{\footnotesize Dummy text}
        \bigstrut\\ \hline
        \scriptsize Auftragnehmer:
        & \multicolumn{3}{c}{\includegraphics[valign=c,scale=0.2]{example-image-a}}
        & \multicolumn{3}{l}{\footnotesize Dummy text}
        \bigstrut\\ \hline
        \multicolumn{2}{@{}l|}{\scriptsize Projekt:}
        & \scriptsize Vertrag Nr.:
        & \multicolumn{3}{@{}l|}{\scriptsize Dokument Nr.:}
        & \scriptsize Seite:
        & \textbf{\footnotesize \thepage}
        \bigstrut\\ \cline{7-8} 
        \multicolumn{2}{c|}{\textbf{\makecell{\footnotesize 1}}}
        &
        & \multicolumn{3}{c|}{\textbf{\footnotesize 1}} 
        & \makecell[l]{\scriptsize Gesamte\\\scriptsize Seite:}
        & \textbf{\footnotesize \pageref*{LastPage}}
        \bigstrut\\ \hline
        \multicolumn{2}{@{}l|}{\scriptsize Titel:}
        & \scriptsize Rahmen:
        & \multicolumn{3}{@{}l|}{\scriptsize Rev.:}
        & \scriptsize Format:
        & \textbf{\footnotesize A4}
        \bigstrut\\ \cline{7-8} 
        \multicolumn{2}{c|}{\textbf{\footnotesize 1}}
        & \centering\textbf{\footnotesize 1:1}
        & \multicolumn{3}{c|}{\textbf{\footnotesize A}}
        & \scriptsize Sprache:
        & \textbf{\footnotesize DE}
        \bigstrut\\ \hline
        \end{tabular}%
    };
    \end{tikzpicture}
}

\begin{document}
Dummy text
\end{document}
  • please limit your document example only to table. if \multicolum spilling out of table border, than you need to define it width for example with column type p{<width>}, which will in the case of longer text in its content break it in more lines. – Zarko Jul 6 '18 at 9:41
  • Hi @Zarko, I have reduced MWE, i have defined column width with p{<width>} but it is smaller than it should be. – Beginner Jul 6 '18 at 10:28
  • your example is not very minimal still! also it has dozens of \multicolumn and it's not clear which one you are asking about, or how you want the output to change. – David Carlisle Jul 6 '18 at 10:35
  • note that the yellow measurements on your image are not taking account of the width of the vertical rules. Perhaps that is the issue? (but I can not tell what you want to change in the output) – David Carlisle Jul 6 '18 at 10:38
  • now i'm on the way. i will look your question very late evening again, if meantime some else solve your problem. if not, i will try to do:-) – Zarko Jul 6 '18 at 10:38
2

You should remove almost all the \multicolumn{1} from the table as they are doing nothing useful: If you use \multicolumn in every cell in a column then the default column specification is not used at all.

Here you specified a p column in the table preamble but then you replaced that by c in every entry so the column is set to the natural width of its content.

You want that column to be a centred, scriptsize parbox with a vertical rule so specify it as

>{\centering \scriptsize}p{2.3cm}@{}|@{}

then the cell data needs no extra markup and can simply be

        & Datum:

I just did that one case here:

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{array}
\usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{makecell}
\usepackage[export]{adjustbox}
\usepackage{graphbox}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{bigstrut}
\usepackage{graphicx}

\usepackage{geometry}
\geometry{paper=a4paper}
\geometry{bindingoffset=1.5cm,hmargin={1.5cm,1.5cm},vmargin={1cm,1cm},
includehead=false,
includefoot=true,footskip=10cm}

\pagestyle{fancy}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}

\fancyhead[CE,CO,LE,LO,RE,RO]{} %% clear out all headers
\fancyfoot[CE,CO,LE,LO,RE,RO]{} %% clear out all footers
\fancyhf{}                      %% clear default for head and foot
\fancyfoot[C]{%
    \begin{tikzpicture}[remember picture,overlay]
    \node[anchor=south west,inner sep=0pt] at ($(current page.south west)+(2.5cm,1cm)$) {
        \begin{tabular}{
@{}p{3cm}@{}@{}
p{2.95cm}@{}|@{}
p{2.3cm}@{}|@{}
>{\centering \scriptsize}p{2.3cm}@{}|@{}
p{2.3cm}@{}|@{}
p{2.3cm}@{}@{}
p{1.5cm}@{}@{}
p{0.8cm}@{}
}
        \cline{3-8}     
        &
        &
        & \multicolumn{1}{c|}{}
        &
        & \multicolumn{1}{c|}{}
        & \multicolumn{2}{c }{}
        \bigstrut\\ \cline{3-8}         
        &
        &
        & \multicolumn{1}{c|}{}
        &
        & \multicolumn{1}{c|}{}
        & \multicolumn{2}{c }{}
        \bigstrut\\ \cline{3-8}         
        &
        &
        & \multicolumn{1}{c|}{}
        &
        & \multicolumn{1}{c|}{}
        & \multicolumn{2}{c }{}
        \bigstrut\\ \cline{3-8}         
        &
        & \centering\textbf{\scriptsize A}
        & \multicolumn{1}{c|}{\textbf{\scriptsize 1}}
        & \centering\textbf{\scriptsize 1}
        & \multicolumn{1}{c|}{\textbf{\scriptsize 1}}
        & \multicolumn{2}{c }{\textbf{\scriptsize 1}}
        \bigstrut\\ \cline{3-8}         
        &
        & \multicolumn{1}{c|}{\scriptsize Rev.:}
        & Datum:
        & \multicolumn{1}{c|}{\scriptsize Gezeichnet:}
        & \multicolumn{1}{c|}{\scriptsize Überprüft:}
        & \multicolumn{2}{c }{\scriptsize Genehmigt:}
        \bigstrut\\ \hline
        \scriptsize Klient:
        & \multicolumn{3}{c}{\includegraphics[valign=c,scale=0.2]{example-image-a}}
        & \multicolumn{3}{l}{\footnotesize Dummy text}
        \bigstrut\\ \hline
        \scriptsize Auftragnehmer:
        & \multicolumn{3}{c}{\includegraphics[valign=c,scale=0.2]{example-image-a}}
        & \multicolumn{3}{l}{\footnotesize Dummy text}
        \bigstrut\\ \hline
        \multicolumn{2}{@{}l|}{\scriptsize Projekt:}
        & \scriptsize Vertrag Nr.:
        & \multicolumn{3}{@{}l|}{\scriptsize Dokument Nr.:}
        & \scriptsize Seite:
        & \textbf{\footnotesize \thepage}
        \bigstrut\\ \cline{7-8} 
        \multicolumn{2}{c|}{\textbf{\makecell{\footnotesize 1}}}
        &
        & \multicolumn{3}{c|}{\textbf{\footnotesize 1}} 
        & \makecell[l]{\scriptsize Gesamte\\\scriptsize Seite:}
        & \textbf{\footnotesize \pageref*{LastPage}}
        \bigstrut\\ \hline
        \multicolumn{2}{@{}l|}{\scriptsize Titel:}
        & \scriptsize Rahmen:
        & \multicolumn{3}{@{}l|}{\scriptsize Rev.:}
        & \scriptsize Format:
        & \textbf{\footnotesize A4}
        \bigstrut\\ \cline{7-8} 
        \multicolumn{2}{c|}{\textbf{\footnotesize 1}}
        & \centering\textbf{\footnotesize 1:1}
        & \multicolumn{3}{c|}{\textbf{\footnotesize A}}
        & \scriptsize Sprache:
        & \textbf{\footnotesize DE}
        \bigstrut\\ \hline
        \end{tabular}%
    };
    \end{tikzpicture}
}

\begin{document}
Dummy text
\end{document}

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.