\documentclass[12pt]{article}
\usepackage{longtable}
\usepackage[landscape]{geometry}
\usepackage{pdflscape}
\begin{document}
\begin{center}
\begin{longtable}{|p{3cm}|p{6cm}|p{6cm}|p{6cm}|}
\caption{A simple longtable example}\\
\hline
\textbf{Items} & \textbf{2018} & \textbf{2019} & \textbf{2020} \\
\hline
\endfirsthead
\multicolumn{4}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\textbf{Items} & \textbf{2018} & \textbf{2019} & \textbf{2020} \\
\hline
\endhead
\hline \multicolumn{4}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
\begin{itemize} \item TEAM/ UNIT/ Organisation \end{itemize}
& \begin{itemize}
\item To maintain staff passion to maintain data provider trust in
releasing data because the data providers could get feedbacks during
verifications.
\end{itemize}
& \begin{enumerate}\item To explore the Idea of a merger* with existing
expertise/resources in MOH to upgrade the hardcopy reports into
electronic version ie bona fide Performance Dashboard possibly using the
system that has been developed.
\item Use the prototype Performance Dashboard to help clients “see” its
potentials to help them in their work, so that they can come up with what
matters to them (direction) that eventually helps MHPU/PIK to revise
their strategic plans/performance metrics
\end{enumerate}
& \begin{itemize} \item To maintain staff passion to maintain data
provider trust in releasing data because the data providers could get
feedbacks during verifications.
\end{itemize} \\
\hline
Team/ Unit/ Organisation & To maintain staff passion to maintain data
provider trust in releasing data because the data providers could get
feedbacks during verifications.
& 1.To maintain staff passion to maintain data provider trust in
releasing data because the data providers could get feedbacks during
verifications.
2.To explore the Idea of a merger* with existing expertise/resources to
upgrade the hardcopy reports into electronic version ie bona fide
Performance Dashboard possibly using the system that has been developed
by
3. Use the prototype Performance Dashboard to help clients “see” its
potentials to help them in their work, so that they can come up with
what matters to them (direction) that eventually helps MHPU/PIK to revise
their strategic plans/performance metrics.
4. To explore the Idea of a merger* with existing expertise/resources in
MOH to upgrade the hardcopy reports into electronic version ie bona fide
Performance Dashboard possibly using the system that has been developed.
5. To explore the Idea of a merger* with existing expertise/resources
to upgrade the hardcopy reports into electronic version ie bona fide
Performance Dashboard possibly using the system that has been developed.
& To maintain staff passion to maintain data provider trust in releasing
data because the data providers could get feedbacks during
verifications. \\
11111111111 & 22222222222222222222222 & 3333333333333333 & 444444 \\
1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
1 & 2 & 3 & 4 \\1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
1 & 2 & 3 & 4
\end{longtable}
\end{center}
\end{document}
2 Answers
With the help of enumitem and column widths calculated relative to the textwidth you can achieve the following:
Using different column widths you can save quite a lot of space:
\documentclass[12pt]{article}
\usepackage{longtable}
\usepackage[landscape]{geometry}
\usepackage{ragged2e}
\usepackage{calc,array}
\usepackage{enumitem}
\newlist{tabitem}{itemize}{1}
\newlist{tabenum}{enumerate}{1}
\setlist[tabitem]{nosep,
topsep= 0pt,
partopsep=0pt,
leftmargin= *,
label=\textbullet,
before=\vspace{-0.6\baselineskip},
after=\vspace{-\baselineskip}
}
\setlist[tabenum]{nosep,
topsep= 0pt,
partopsep=0pt,
leftmargin= *,
label=\arabic*.,
before=\vspace{-0.6\baselineskip},
after=\vspace{-\baselineskip}
}
\begin{document}
{\RaggedRight
\begin{longtable}{|p{0.145\textwidth-2\tabcolsep-2\arrayrulewidth}|p{0.285\textwidth-2\tabcolsep-\arrayrulewidth}|p{0.285\textwidth-2\tabcolsep-\arrayrulewidth}|p{0.285\textwidth-2\tabcolsep-\arrayrulewidth}|}
\caption{A simple longtable example}\\
\hline
\textbf{Items} & \textbf{2018} & \textbf{2019} & \textbf{2020} \\
\hline
\endfirsthead
\multicolumn{4}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\textbf{Items} & \textbf{2018} & \textbf{2019} & \textbf{2020} \\
\hline
\endhead
\hline \multicolumn{4}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
\begin{tabitem} \item TEAM/ UNIT/ Organisation \end{tabitem}
& \begin{tabitem}
\item To maintain staff passion to maintain data provider trust in releasing
data because the data providers could get feedbacks during verifications.
\end{tabitem}
& \begin{tabenum}\item To explore the Idea of a merger* with existing
expertise/resources in MOH to upgrade the hardcopy reports into electronic
version ie bona fide Performance Dashboard possibly using the system that
has been developed.
\item Use the prototype Performance Dashboard to help clients “see” its
potentials to help them in their work, so that they can come up with what
matters to them (direction) that eventually helps MHPU/PIK to revise their
strategic plans/performance metrics
\end{tabenum}
& \begin{tabitem} \item To maintain staff passion to maintain data
provider trust in releasing data because the data providers could get
feedbacks during verifications.
\end{tabitem} \\
\hline
\end{longtable}}
{\RaggedRight
\begin{longtable}{|p{0.145\textwidth-2\tabcolsep-2\arrayrulewidth}|p{0.2\textwidth-2\tabcolsep-\arrayrulewidth}|p{0.455\textwidth-2\tabcolsep-\arrayrulewidth}|p{0.2\textwidth-2\tabcolsep-\arrayrulewidth}|}
\caption{A simple longtable example}\\
\hline
\textbf{Items} & \textbf{2018} & \textbf{2019} & \textbf{2020} \\
\hline
\endfirsthead
\multicolumn{4}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\textbf{Items} & \textbf{2018} & \textbf{2019} & \textbf{2020} \\
\hline
\endhead
\hline \multicolumn{4}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
\begin{tabitem} \item TEAM/ UNIT/ Organisation \end{tabitem}
& \begin{tabitem}
\item To maintain staff passion to maintain data provider trust in releasing
data because the data providers could get feedbacks during verifications.
\end{tabitem}
& \begin{tabenum}\item To explore the Idea of a merger* with existing
expertise/resources in MOH to upgrade the hardcopy reports into electronic
version ie bona fide Performance Dashboard possibly using the system that
has been developed.
\item Use the prototype Performance Dashboard to help clients “see” its
potentials to help them in their work, so that they can come up with what
matters to them (direction) that eventually helps MHPU/PIK to revise their
strategic plans/performance metrics
\end{tabenum}
& \begin{tabitem} \item To maintain staff passion to maintain data
provider trust in releasing data because the data providers could get
feedbacks during verifications.
\end{tabitem} \\
\hline
\end{longtable}}
\end{document}
Regarding the edited question:
longtable can only break a table between rows. If you have a long list in a single table row there can not be a pagebreak within this list as you see in your example. To enable page breaks, you can split the list into several rows and use the series and resume approach for continued numbering as shown in the following example:
\documentclass[12pt]{article}
\usepackage{longtable}
\usepackage[landscape]{geometry}
\usepackage{ragged2e}
\usepackage{calc,array}
\usepackage{enumitem}
\newlist{tabitem}{itemize}{1}
\newlist{tabenum}{enumerate}{1}
\setlist[tabitem]{nosep,
topsep= 0pt,
partopsep=0pt,
leftmargin= *,
label=\textbullet,
before=\vspace{-0.6\baselineskip},
after=\vspace{-\baselineskip}
}
\setlist[tabenum]{nosep,
topsep= 0pt,
partopsep=0pt,
leftmargin= *,
label=\arabic*.,
before=\vspace{-0.6\baselineskip},
after=\vspace{-\baselineskip},
}
\begin{document}
{\RaggedRight
\begin{longtable}{|p{0.145\textwidth-2\tabcolsep-2\arrayrulewidth}|p{0.2\textwidth-2\tabcolsep-\arrayrulewidth}|p{0.455\textwidth-2\tabcolsep-\arrayrulewidth}|p{0.2\textwidth-2\tabcolsep-\arrayrulewidth}|}
\caption{A simple longtable example}\\
\hline
\textbf{Items} & \textbf{2018} & \textbf{2019} & \textbf{2020} \\
\hline
\endfirsthead
\multicolumn{4}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\textbf{Items} & \textbf{2018} & \textbf{2019} & \textbf{2020} \\
\hline
\endhead
\hline \multicolumn{4}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
\begin{tabitem} \item TEAM/ UNIT/ Organisation \end{tabitem}
& \begin{tabitem}
\item To maintain staff passion to maintain data provider trust in releasing
data because the data providers could get feedbacks during verifications.
\end{tabitem}
& \begin{tabenum}[series=enum]\item To explore the Idea of a merger* with existing
expertise/resources in MOH to upgrade the hardcopy reports into electronic
version ie bona fide Performance Dashboard possibly using the system that
has been developed.
\item Use the prototype Performance Dashboard to help clients “see” its
potentials to help them in their work, so that they can come up with what
matters to them (direction) that eventually helps MHPU/PIK to revise their
strategic plans/performance metrics
\end{tabenum}
& \begin{tabitem} \item To maintain staff passion to maintain data
provider trust in releasing data because the data providers could get
feedbacks during verifications.
\end{tabitem} \\
&& \begin{tabenum}[resume=enum] \item To explore the Idea of a merger* with existing
expertise/resources in MOH to upgrade the hardcopy reports into electronic
version ie bona fide Performance Dashboard possibly using the system that
has been developed.
\item Use the prototype Performance Dashboard to help clients “see” its
potentials to help them in their work, so that they can come up with what
matters to them (direction) that eventually helps MHPU/PIK to revise their
strategic plans/performance metrics
\end{tabenum} & \\
&& \begin{tabenum}[resume=enum] \item To explore the Idea of a merger* with existing
expertise/resources in MOH to upgrade the hardcopy reports into electronic
version ie bona fide Performance Dashboard possibly using the system that
has been developed.
\item Use the prototype Performance Dashboard to help clients “see” its
potentials to help them in their work, so that they can come up with what
matters to them (direction) that eventually helps MHPU/PIK to revise their
strategic plans/performance metrics
\end{tabenum} & \\
\hline
\end{longtable}}
\end{document}
- 62,593
-
thanks @leandriis for helping me. ('',) thanks for taught me about enumitem. But I still have problem on how make the sentences in long table automatically go the next page... – anis Feb 13 '19 at 00:58
-
@anis leandriis suggests that you should use different column widths to save spaces. If you save space, you don't have to care about putting a sentence to the next page, as I can see. – Feb 13 '19 at 01:30
-
@anis: Please see my updated answer. See also Longtable: page breaks within row possible? – leandriis Feb 13 '19 at 19:20
As you've already been informed, the longtable environment can only create page breaks at the end of a "row". However, by making the second data column about four times as wide as the other two, it's possible to fit both "rows" of the longtable on a single page.
In the following code, I've also customized the itemize and enumerate environment, to make them take up as little space as possible.
Since the columns are quite narrow, I suggest you switch from fully-justified to raggedright appearance.
Another hint: you seem to use the symbol / ("slash") quite a bit to form word pairs and even triples. LaTeX will in general not allow line breaks at the / symbols. I suggest you replace all instances of / with \slash (note the extra space); that way, line breaks are possible once again. For example, I suggest you switch from Team/Unit/Organisation to Team\slash Unit\slash Organisation.
\documentclass[12pt,a4paper]{article}
\usepackage{longtable}
\usepackage[margin=2cm,landscape]{geometry}
\usepackage[english]{babel}
\usepackage{array,ragged2e}
\newcolumntype{P}[1]{>{\RaggedRight\arraybackslash}p{#1}}
\usepackage{enumitem}
%% customize 'itemize' and 'enumerate' environments:
\setlist[itemize]{wide=0pt,nosep,
before = \vspace{-\baselineskip},
after = \vspace{-\baselineskip}}
\setlist[enumerate]{wide=0pt,nosep,
before = \vspace{-\baselineskip},
after = \vspace{-\baselineskip}}
\begin{document}
\setlength\extrarowheight{1.5pt}
\begin{longtable}{|P{2.5cm}|P{4cm}|P{12cm}|P{4cm}|}
%% headers and footers
\caption{A single-page longtable example}\\
\hline
\textbf{Items} & \textbf{2018} & \textbf{2019} & \textbf{2020} \\
\hline
\endfirsthead
\multicolumn{4}{c}{\tablename\ \thetable,
\textit{Continued from previous page}} \\
\hline
\textbf{Items} & \textbf{2018} &
\textbf{2019} & \textbf{2020} \\
\hline
\endhead
\hline
\multicolumn{4}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
%% body of table
\begin{itemize}
\item TEAM\slash UNIT\slash Organisation
\end{itemize}
&
\begin{itemize}
\item To maintain staff passion to maintain data provider trust in releasing data because the data providers could get feedbacks during verifications.
\end{itemize}
&
\begin{enumerate}
\item To explore the Idea of a merger* with existing expertise\slash resources in MOH to upgrade the hardcopy reports into electronic version ie bona fide Performance Dashboard possibly using the system that has been developed.
\item Use the prototype Performance Dashboard to help clients ``see'' its potentials to help them in their work, so that they can come up with what matters to them (direction) that eventually helps MHPU\slash PIK to revise their strategic plans\slash performance metrics
\end{enumerate}
&
\begin{itemize}
\item To maintain staff passion to maintain data provider trust in releasing data because the data providers could get feedbacks during verifications.
\end{itemize}
\\ % end of first "row"
\hline
Team\slash Unit\slash Organisation
&
To maintain staff passion to maintain data provider trust in releasing data because the data providers could get feedbacks during verifications.
&
\begin{enumerate}
\item To maintain staff passion to maintain data provider trust in releasing data because the data providers could get feedbacks during verifications.
\item To explore the Idea of a merger* with existing expertise\slash resources to upgrade the hardcopy reports into electronic version ie bona fide Performance Dashboard possibly using the system that has been developed by
\item Use the prototype Performance Dashboard to help clients ``see'' its potentials to help them in their work, so that they can come up with what matters to them (direction) that eventually helps MHPU\slash PIK to revise their strategic plans\slash performance metrics.
\item To explore the Idea of a merger* with existing expertise\slash resources in MOH to upgrade the hardcopy reports into electronic version ie bona fide Performance Dashboard possibly using the system that has been developed.
\item To explore the Idea of a merger* with existing expertise\slash resources to upgrade the hardcopy reports into electronic version ie bona fide Performance Dashboard possibly using the system that has been developed.
\end{enumerate}
&
To maintain staff passion to maintain data provider trust in releasing data because the data providers could get feedbacks during verifications.
\\ % end of second "row"
\end{longtable}
\end{document}
- 506,678
-
thanks a lot @mico for helping me. i am a beginner in latex. thanks for tip about the symbol. – anis Feb 14 '19 at 03:58





longtableenvironment inside acenterenvironment. – Mico Feb 13 '19 at 19:27