0

I have long table "six pages" in word. I'm moving my work to latex but the table appears in bad way and not showing all the rows nether the columns.

enter image description here

\begin{longtable}[H]
    \centering
    \caption{List of published articles selected for the systematic review}
    \label{tab:my-table}
    \begin{tabular}{|c|c|c|c|c|l|c|}
    \hline
    \rowcolor[HTML]{EFEFEF}
    \textbf{ID} &
    \textbf{Reference} &
    \textbf{Year} &
    \textbf{Country} &
    \textbf{Study Period} &
    \multicolumn{1}{c|}{\cellcolor[HTML]{EFEFEF}\textbf{Model / Methods}} &
    \textbf{Techniques Category} \\ \hline
1 &
  \cite{hales2002potential} &
  2002 &
  Global &
  \begin{tabular}[c]{@{}c@{}}1975\\ -\\ 1996\end{tabular} &
  \begin{tabular}[c]{@{}l@{}}- Logistic Regression\\ - Spatial 
2
  • 1
    Welcome to TeX SX! You don't have to nest a tabular environment in a longtable. Also, if you want columns with multiline cells, don't use the r, l or c column types. Last you point, you should read the longtable documentation, as it has a special syntax.
    – Bernard
    Sep 5, 2021 at 11:02
  • Please also make your code compilable by adding the documentclass as well as the relevant packages. Also, what kind of contents will the "Techniques categories" column contain: single words, lext, a list,...?
    – leandriis
    Sep 5, 2021 at 12:14

1 Answer 1

1

Your table is quite wide and I seriously doubt it will fit onto a page while keeping a reasonable font size and margins. I therefore suggest to rotate the table to landscape orientation. The following may serve as a starting point:

enter image description here

\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{xltabular}

\usepackage{pdflscape}
\usepackage{enumitem}
\newlist{tabitem}{itemize}{1}
\setlist[tabitem]{label=--, noitemsep,leftmargin=*,topsep=0pt,partopsep=0pt, nosep, before=\begin{minipage}[t]{\hsize}, after=\end{minipage}}

\begin{document}


\begin{landscape}
\begin{xltabular}{\linewidth}{|r|c|c|>{\centering\arraybackslash}p{1.5cm}|c|X|X|}
    \caption{List of published articles selected for the systematic review}
    \label{tab:my-table}\\
    \hline
    \rowcolor[HTML]{EFEFEF}
    \textbf{ID} &
    \textbf{Ref.} &
    \textbf{Year} &
    \textbf{Country} &
    \textbf{Study Period} &
    \textbf{Model / Methods} &
    \textbf{Techniques Category} \\ \hline
    \endfirsthead
    \caption{List of published articles selected for the systematic review - continued from previous page}\\
    \hline
    \rowcolor[HTML]{EFEFEF}
    \textbf{ID} &
    \textbf{Ref.} &
    \textbf{Year} &
    \textbf{Country} &
    \textbf{Study Period} &
    \textbf{Model / Methods} &
    \textbf{Techniques Category} \\ \hline
    \endhead
1 &
  \cite{hales2002potential} &
  2002 &
  Global &
 1975 -- 1996 &
 \begin{tabitem}
   \item Logistic Regression
   \item Spatial
 \end{tabitem} &
 some text in the last column 
\end{xltabular}
\end{landscape}  
\end{document}
3
  • Thank you for your comment. I have edited it but the table still contain problems. The text in the columns are over each other
    – asiddiq
    Sep 6, 2021 at 3:38
  • I have saved my table as PDF (six pages) and used this commands lines: \begin{xltabular}[H] \caption{List of published articles selected for the systematic review} \label{tbl:table2} \includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{Systematic/table.pdf} \end{xltabular} But only one page shows the table + this way cause a problem for me since I can't show the citation in the second column.
    – asiddiq
    Sep 6, 2021 at 3:42
  • @asiddiq: What does "The text in the columns are over each other" mean?
    – leandriis
    Sep 6, 2021 at 12:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .