0

Having a table like the following. Is it possible to make only for this table to be in one single page in landscape and force the cells to break line if the text is too long so the table fit in the size of the page?

\documentclass[preprint,12pt]{elsarticle}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\begin{document}
\begin{table}[]
\begin{tabular}{llll}
What is Lorem Ipsum      & What is Lorem Ipsum      & Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing                                                                                                                       & What is Lorem Ipsum      \\
Where does it come from? & Where does it come from? & It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very & Where does it come from? \\
Why do we use it?        & Why do we use it?        & There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined                                                                                                                                                           & Why do we use it?        \\
Where can I get some?    & Where can I get some?    & It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web                                                                                                       & Where can I get some?   
\end{tabular}
\end{table}
\end{document}
Bernard
  • 271,350
foc
  • 147
  • For landscape mode, use \usepackage[landscape]{geometry}, and for word wrapping in the table, instead of the l column, use p{0.25\linewidth} four times. See this wikibooks article for more on this p type. And if you want to have a table over several pages, see this question. – Jānis Lazovskis May 08 '20 at 17:35
  • 1
    I suggest using tabularx and its X type column. Also, sidewaystable from the rotating package might be an alternative to landscape. – leandriis May 08 '20 at 18:27
  • If you really want to get fancy, use pdflscape and afterpage. See https://tex.stackexchange.com/questions/258595/rotate-landscape-for-single-page-and-also-the-pagenumber?r=SearchResults&s=10|26.5587 for example. – John Kormylo May 08 '20 at 22:50

1 Answers1

1

enter image description here

\documentclass[preprint,12pt]{elsarticle}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{tabularx}
\usepackage{ltablex}
\usepackage{lscape}
\usepackage{booktabs}
\begin{document}
\begin{landscape}
\begin{tabularx}{\linewidth}{XXXX}\toprule[2pt]
What is Lorem Ipsum      & What is Lorem Ipsum      & Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing                                                                                                                       & What is Lorem Ipsum      \\ \midrule

Where does it come from? & Where does it come from? & It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very & Where does it come from? \\ \midrule
Why do we use it?        & Why do we use it?        & There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined                                                                                                                                                           & Why do we use it?        \\ \midrule
Where can I get some?    & Where can I get some?    & It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web                                                                                                       & Where can I get some? \\ \bottomrule[2pt]  
\end{tabularx}
\end{landscape}
\end{document}
js bibra
  • 21,280