Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a table which spans into multiple pages. but, I could not get the table spanning into multiple pages. here is my MWE.

\documentclass[a4paper,10pt]{book}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{pstricks}
\usepackage{epstopdf}

\usepackage{pdflscape}    % to change certain pages to landscape mode
\usepackage{array}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash\hspace{0pt}\mybreaks}p{#1}}

% Macro for my work
\begingroup
\catcode`=\active
\catcode`-\active
\catcode`)\active
\gdef\mybreaks{%
\catcode`=\active\edef={\string=\penalty0 }%
\catcode`)\active\edef){\string)\penalty0 }%
\catcode`-\active\edef-{\string-\penalty0 }}
\endgroup


\usepackage{verbatim}       % to commenet multiline


\usepackage{cite} %for compressing referenceing

\usepackage[para]{footmisc}

\usepackage{longtable}

\usepackage{booktabs,chemnum}
\usepackage[version=3]{mhchem}

\usepackage{imakeidx}
\makeindex

\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\usepackage{xparse}% http://ctan.org/pkg/xparse

% another macro for my work
\newcounter{compoundcntr} \newcounter{subcompoundcntr}[compoundcntr]
\renewcommand{\thesubcompoundcntr}{\thecompoundcntr\alph{subcompoundcntr}}
 \NewDocumentCommand{\compound}{s o m}{%
  \IfBooleanTF{#1}
   {% \compound*[<label>]{<name>}
     \IfNoValueTF{#2}
      {#3}% \compound{<name>}
      {\stepcounter{compoundcntr}\refstepcounter{subcompoundcntr}#3,         \thesubcompoundcntr\label{#2}}% \compound[<label>]{<name>}
    }
{% \compound[<label>]{<name>}
  \IfNoValueTF{#2}
    {#3}% \compound*{<name>}
    {\refstepcounter{subcompoundcntr}#3, \thesubcompoundcntr\label{#2}}% \compound*      [<label>]{<name>}
    }
}


 \begin{document}

\begin{tabular}{|p{1cm}|p{1cm}|}
 \hline 
 Names & Score \tabularnewline \hline 
 A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
A & 1 \tabularnewline \hline 
\end{tabular}

\end{document}

The question is how to make the table to span thro multiple pages. May be the reordering of the packages may be an option.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

The example is not using a longtable environment it is using tabular which never breaks across pages. Change the tabular to longtable.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.