1

this is my latex, the columns always see to go over the page width. I know I set width using p instead of l. However, using p, the tables disappears to the next page where it is portrait mode.

\documentclass[runningheads]{llncs}

\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{cite}
\usepackage[export]{adjustbox}
\usepackage{multirow}
\usepackage{float}
\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{capt-of}% or use the larger `caption` package
\usepackage[normalem]{ulem}
\usepackage{array}

    \afterpage{%
    \clearpage% Flush earlier floats (otherwise order might not be correct)
    \thispagestyle{empty}% empty page style (?)
    \begin{landscape}% Landscape page
\useunder{\uline}{\ul}{}

\begin{table}[]
\begin{tabular}{llll}
\hline
\textbf{Name(Store)}                                   & \textbf{Purpose}                  & \textbf{Support}                                                                       & \textbf{Medical References}                                                                                         \\ \hline
{\ul IBS (Google Play)}                       & Pain Assistance          & No                                                                            & Unknown. There is no direct (cited) scientific basis. Authors on the website do have a medical background. \\
{\ul FODMAP A toZ (Google Play, Apple Store)} & Diet                     & No, but contacting a qualified physician before adjusting the diet is advised & Unknown, created by patient.                                                                               \\
{\ul MySymptoms (Google Play, Apple Store)}   & Journal (Diet, Symptoms) & No, but contacting a qualified physician before adjusting the diet is advised & Unknown. However the included blogs do.                                                                    \\
{\ul Curing IBS (Google Play)}                & Informative              & No                                                                            & Unknown, created by patient.                                                                               \\
{\ul My IBS Diary (Google Play)}              & Journal (Diet, Symptoms) & Yes, cvs file can be exported and sent to physician                           & Unknown                                                                                                    \\
{\ul Irritable Bowel Syndrome (Google Play)}  & Informative              & No                                                                            & Unknown                                                                                                    \\
{\ul Zemedy}                                  & Therapy                  & Yes, expert can be contacted in the app                                       & Yes. (Latest) Medical references are listed                                                                \\
{\ul Monash University FODMAP diet}           & Journal (Diet)           & No                                                                            & Yes. Created at Monash University                                                                          \\
{\ul Bristol Stool Chart}                     & Journal                  & Yet, csv file can be exported and sent to physician                           & Yes, namely the Bristol Stool Chart.                                                                       \\
                                              &                          &                                                                               &                                                                                                           
\end{tabular}
\end{table}

\captionof{table}{Table caption}% Add 'table' caption
    \end{landscape}
    \clearpage% Flush page
}

This is the result enter image description here

6
  • Please mak e acomplete compilable minimal working example (MWE) by adding the documentclass and the relevant packages. Regarding your issue: you might be interested in the tabularx package.
    – leandriis
    Mar 20, 2019 at 14:39
  • the last change the l to >{\raggedright\arraybackslash}p{...} with ... chosen so the table is not too wide, Mar 20, 2019 at 14:43
  • Apart from that, why do you use captionof in combination with a table and landscape?
    – leandriis
    Mar 20, 2019 at 14:44
  • @leandriis, not supposed to?
    – Floris071
    Mar 20, 2019 at 14:55
  • @leandriis , added the packages
    – Floris071
    Mar 20, 2019 at 15:00

1 Answer 1

3

Here is a version using tabularx to allow the table to be as wide as the textwidth. I have also removed the table environment as it is not needed here:

\documentclass[runningheads]{llncs}

\usepackage{float}
\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{capt-of}% or use the larger `caption` package
\usepackage[normalem]{ulem}

\usepackage{tabularx}


\begin{document}


    \afterpage{%
    \clearpage% Flush earlier floats (otherwise order might not be correct)
    \thispagestyle{empty}% empty page style (?)
    \begin{landscape}% Landscape page
\useunder{\uline}{\ul}{}

%\begin{table}[]
\begin{tabularx}{\linewidth}{XlXX}
\hline
\textbf{Name(Store)}                                   & \textbf{Purpose}                  & \textbf{Support}                                                                       & \textbf{Medical References}                                                                                         \\ \hline
{\ul IBS  (Google Play)}                       & Pain Assistance          & No                                                                            & Unknown. There is no direct (cited) scientific basis. Authors on the website do have a medical background. \\
{\ul FODMAP A toZ  (Google Play, Apple Store)} & Diet                     & No, but contacting a qualified physician before adjusting the diet is advised & Unknown, created by patient.                                                                               \\
{\ul MySymptoms  (Google Play, Apple Store)}   & Journal (Diet, Symptoms) & No, but contacting a qualified physician before adjusting the diet is advised & Unknown. However the included blogs do.                                                                    \\
{\ul Curing IBS (Google Play)}                & Informative              & No                                                                            & Unknown, created by patient.                                                                               \\
{\ul My IBS Diary  (Google Play)}              & Journal (Diet, Symptoms) & Yes, cvs file can be exported and sent to physician                           & Unknown                                                                                                    \\
{\ul Irritable Bowel Syndrome (Google Play)}  & Informative              & No                                                                            & Unknown                                                                                                    \\
{\ul Zemedy}                                  & Therapy                  & Yes, expert can be contacted in the app                                       & Yes. (Latest) Medical references are listed                                                                \\
{\ul Monash University FODMAP diet}           & Journal (Diet)           & No                                                                            & Yes. Created at Monash University                                                                          \\
{\ul Bristol Stool Chart}                     & Journal                  & Yet, csv file can be exported and sent to physician                           & Yes, namely the Bristol Stool Chart.                                                                       \\
                                              &                          &                                                                               &                                                                                                           
\end{tabularx}

\captionof{table}{Table caption}% Add 'table' caption
    \end{landscape}
    \clearpage% Flush page
}


\end{document}

enter image description here


Here I have used the sidewaystable environment from the rotating package instead of the landscape approach:

\documentclass[runningheads]{llncs}

\usepackage{float}
\usepackage[normalem]{ulem}

\usepackage{tabularx}
\usepackage{rotating}


\begin{document}



    \begin{sidewaystable}
\useunder{\uline}{\ul}{}


\begin{tabularx}{\linewidth}{XlXX}
\hline
\textbf{Name(Store)}                                   & \textbf{Purpose}                  & \textbf{Support}                                                                       & \textbf{Medical References}                                                                                         \\ \hline
{\ul IBS  (Google Play)}                       & Pain Assistance          & No                                                                            & Unknown. There is no direct (cited) scientific basis. Authors on the website do have a medical background. \\
{\ul FODMAP A toZ  (Google Play, Apple Store)} & Diet                     & No, but contacting a qualified physician before adjusting the diet is advised & Unknown, created by patient.                                                                               \\
{\ul MySymptoms  (Google Play, Apple Store)}   & Journal (Diet, Symptoms) & No, but contacting a qualified physician before adjusting the diet is advised & Unknown. However the included blogs do.                                                                    \\
{\ul Curing IBS (Google Play)}                & Informative              & No                                                                            & Unknown, created by patient.                                                                               \\
{\ul My IBS Diary  (Google Play)}              & Journal (Diet, Symptoms) & Yes, cvs file can be exported and sent to physician                           & Unknown                                                                                                    \\
{\ul Irritable Bowel Syndrome (Google Play)}  & Informative              & No                                                                            & Unknown                                                                                                    \\
{\ul Zemedy}                                  & Therapy                  & Yes, expert can be contacted in the app                                       & Yes. (Latest) Medical references are listed                                                                \\
{\ul Monash University FODMAP diet}           & Journal (Diet)           & No                                                                            & Yes. Created at Monash University                                                                          \\
{\ul Bristol Stool Chart}                     & Journal                  & Yet, csv file can be exported and sent to physician                           & Yes, namely the Bristol Stool Chart.                                                                       \\
                                              &                          &                                                                               &                                                                                                           
\end{tabularx}

\caption{Table caption}
    \end{sidewaystable}


\end{document}

enter image description here


This last example contains some suggestions on how you could increase the readability of your table (I have removed the underline commands, added horizontal ruleds from the booktabs package as well as some more horizontal and vertical space between the columns and rows. Lastly, I have also used some abbreviations in order to save some space in the table)

\documentclass[runningheads]{llncs}

\usepackage{float}
\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{capt-of}% or use the larger `caption` package
\usepackage[normalem]{ulem}

\usepackage{tabularx}
\usepackage{booktabs}


\begin{document}


    \afterpage{%
    \clearpage% Flush earlier floats (otherwise order might not be correct)
    \thispagestyle{empty}% empty page style (?)
    \begin{landscape}% Landscape page
\setlength\extrarowheight{3pt} 
\setlength{\tabcolsep}{6pt}

\begin{tabularx}{\linewidth}{>{\raggedright\arraybackslash}p{3cm}l>{\raggedright\arraybackslash}X>{\raggedright\arraybackslash}X}
\toprule
\textbf{Name(Store)}                                   & \textbf{Purpose}                  & \textbf{Support}                                                                       & \textbf{Medical References}                                                                                         \\ \midrule
{ IBS  (GP)}                       & Pain Assistance          & No                                                                            & Unknown. There is no direct (cited) scientific basis. Authors on the website do have a medical background. \\
{ FODMAP A toZ  (GP, AS)} & Diet                     & No, but contacting a qualified physician before adjusting the diet is advised & Unknown, created by patient.                                                                               \\
{ MySymptoms  (GP, AS)}   & Journal (Diet, Symptoms) & No, but contacting a qualified physician before adjusting the diet is advised & Unknown. However the included blogs do.                                                                    \\
{ Curing IBS (GP)}                & Informative              & No                                                                            & Unknown, created by patient.                                                                               \\
{ My IBS Diary  (GP)}              & Journal (Diet, Symptoms) & Yes, cvs file can be exported and sent to physician                           & Unknown                                                                                                    \\
{ Irritable Bowel Syndrome (GP)}  & Informative              & No                                                                            & Unknown                                                                                                    \\
{ Zemedy}                                  & Therapy                  & Yes, expert can be contacted in the app                                       & Yes. (Latest) Medical references are listed                                                                \\
{ Monash University FODMAP diet}           & Journal (Diet)           & No                                                                            & Yes. Created at Monash University                                                                          \\
{ Bristol Stool Chart}                     & Journal                  & Yet, csv file can be exported and sent to physician                           & Yes, namely the Bristol Stool Chart.                                                                       \\
  \bottomrule
  \multicolumn{4}{p{\textwidth}}{Abbreviations: GP = Google Play, AS = Apple Store}
\end{tabularx}

\captionof{table}{Table caption}% Add 'table' caption
    \end{landscape}
    \clearpage% Flush page
}


\end{document}

enter image description here

You must log in to answer this question.

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