[Tex/LaTex] Table spanning multicolumn and multipage using xtabular

tablestimelinextab

I would like to have a timeline where if the length is larger than the page, it will first continue as a second column in the same page, and if required, will continue to the next page's first column, and so on ….

Following is a solution which is based on This answer but this solution is not exactly what should be best for my requirement. In the first link, it has been suggested that this can be achieved using xtabular.

Following is what I have achieved so far:

\documentclass[a4paper,twoside,twocolumn,11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{xtab}
\usepackage[TS1,T1]{fontenc}
\usepackage{fourier, heuristica}
\usepackage{array, booktabs}
\usepackage{graphicx}
\usepackage[x11names,table]{xcolor}
\usepackage{caption}
\DeclareCaptionFont{blue}{\color{LightSteelBlue3}}

\newcommand{\foo}{\color{LightSteelBlue3}\makebox[0pt]{\textbullet}\hskip-0.5pt\vrule width 1pt\hspace{\labelsep}}

\begin{document}


\renewcommand\arraystretch{1.4}\arrayrulecolor{LightSteelBlue3}
\captionsetup{font=blue, labelfont=sc, labelsep=quad,
              skip=0.5\baselineskip}
\topcaption{My List}
\xentrystretch{-0.15} % height of table in each page
\begin{xtabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{6cm}}
% header and footer information
%\addlinespace[1.5ex]

\bottomrule
% body of table
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
\end{xtabular}
\end{document}

What I could not do:

  1. Align the table at the top in both the columns
  2. Making table heights equal (or almost equal) in both the columns
  3. Adding (or Removing from top) the top horizontal border in the subsequent continuation of table.

Thanks for your help.

Best Answer

Some suggestions:

  • Provide \tablefirsthead, \tablehead, and \tablelasttail instructions in addition to \topcaption.

  • In particular, use \tablehead to create a quasi-caption for all text columns but the first.

enter image description here

\documentclass[a4paper,twoside,twocolumn,11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{xtab}
\usepackage[TS1,T1]{fontenc}
\usepackage{fourier, heuristica}
\usepackage{array, booktabs, caption, ragged2e}
\usepackage[x11names,table]{xcolor}
\DeclareCaptionFont{blue}{\color{LightSteelBlue3}}

\newcommand{\foo}{\color{LightSteelBlue3}\makebox[0pt]{\textbullet}\hskip-0.5pt\vrule width 1pt\hspace{\labelsep}}

\begin{document}

\renewcommand\arraystretch{1.4}\arrayrulecolor{LightSteelBlue3}
\captionsetup{font=blue, labelfont=sc, labelsep=quad,
              skip=0.5\baselineskip}
% header and footer information
\topcaption{My List} \label{tab:timeline}
\tablefirsthead{\toprule}
\tablehead{\multicolumn{2}{c}{\color{LightSteelBlue3}\textsc{Table \ref{tab:timeline}}, cont'd}\\[0.6ex]
        \toprule}
\tablelasttail{\bottomrule}
\xentrystretch{-0.15} 

\begin{xtabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\RaggedRight\arraybackslash}p{5cm}}
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
1947 & AT\&T Bell Labs develop the idea of cellular phones\\
1968 & Xerox Palo Alto Research Centre envisage the `Dynabook'\\
1971 & Busicom `Handy-LE' Calculator\\
1973 & First mobile handset invented by Martin Cooper\\
1978 & Parker Bros.\ Merlin Computer Toy\\
1981 & Osborne 1 Portable Computer\\
1982 & Grid Compass 1100 Clamshell Laptop\\
1983 & TRS-80 Model 100 Portable PC\\
1984 & Psion Organiser Handheld Computer\\
1991 & Psion Series 3 Minicomputer\\
\end{xtabular}

\end{document}
Related Question