I'm getting a bit of a strange output when I code in the following:


\multicolumn{1}{|c|}{\textbf{Element}}    &   \multicolumn{2}{c|}{\textbf{Local Nodes}}   &   \multicolumn{2}{c|}{\textbf{Global Nodes}}\\
a & a & a & a & a \\

The final column of the second row (i.e. the one with the 'a's) is misformatted. Additionally, when I try to add more lines to the table, it likes to add the first entry into the fifth column.

I have a feeling I'm just missing a typo in my code.

For reference, here's the preamble:

\title{\bfseries\sffamily\Huge XX}
\author{\sffamily XX}
\date{\sffamily XX}
\usepackage[left=2.5cm, right=2.5cm, top=2.5cm, bottom=2.5cm]{geometry}
\renewcommand{\contentsname}{\Huge \bfseries \sffamily Contents}
\setlength{\parindent}{0pt} %This removes the standard indentation from the 
beginning of paragraphs
{\Huge\bfseries\sffamily} % format
{\Huge{\thechapter}\hspace{2mm}}                % label
{0pt}             % sep
{\Huge}           % before-code 
{\Large\bfseries\sffamily} % format
{\Large{\thesection}\hspace{2mm}}                % label
{0pt}             % sep
{\Large}           % before-code 

Output Output

  • Off-topic but relevant nevertheless: The hyperref package should be loaded last in the preamble of your document. Also: The palatino package is considered deprecated; load the package newpxtext instead. (I see you're also loading the fourier package, presumably for math material. An alternative to fourier would be newpxmath.)
    – Mico
    Aug 10 '17 at 5:48

enter image description here

you should add \arraybackslash after \centering at least in the last column:

    &   \multicolumn{2}{c|}{\textbf{Local Nodes}}
        &   \multicolumn{2}{c|}{\textbf{Global Nodes}}  \\
a & a & a & a & a                                       \\

edit: as Mico suggested in his comment below, you can for simpler table typing define new column type for example as:


and then use it as


(in case of equal width of columns) or for example

\begin{tabular}{|M{15mm}| M{20mm}| M{20mm}| M{10mm}| M{10mm}|}

when their width are different.

  • @MosheHollander, you can accept answer by clicking on check mark on the top left side of answer :). happy tex-ing!
    – Zarko
    Aug 10 '17 at 3:56
  • +1. Since the same column type -- >{\centering\arraybackslash}m -- is used 5 times -- you may want to advise the OP to set up a newcolumn type, called (say) M, as follows: \newcolumntype{M}[1]{{#1}}. Then, the header of the tabular environment may be written more succinctly as \begin{tabular}{|*{5}{M{15mm}|}}. :-)
    – Mico
    Aug 10 '17 at 5:38

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.