2

I want to add a table as headers to all the pages (except title page) in my document. I tried this:

\usepackage{fancyhdr}
%...
\chead{
    \begin{tabular}{l|r}
        Lorem&Ipsum
    \end{tabular}
}

But it did not work. How should I get it done?

2

Add \pagestyle{fancy}

\documentclass[]{article}


\usepackage{fancyhdr}

\pagestyle{fancy}
%...
\chead{
    \begin{tabular}{l|r}
        Lorem&Ipsum\\
        Lorem&Ipsum
    \end{tabular}
}
\lhead{}
\rhead{}

\renewcommand{\headrulewidth}{0pt}

\usepackage{lipsum}

\title{My title}
\begin{document}

\maketitle

\lipsum

\clearpage

\lipsum

\end{document}
  • I get the table now but there is an extra horizontal rule by the fancy pagestyle. Edit: Got it – BBloggsbott Feb 18 at 14:32
  • @BBloggsbott \renewcommand{\headrulewidth}{0pt} or \renewcommand{\headrule}{} – Hafid Boukhoulda Feb 18 at 14:39

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.