1

I already search for some solutions to fit this simple table to page size but whenever I use resizebox or adjustbox the text size becomes too small. So I'm trying to solve this problem with tabular and tabularx but with no success so far:

Here is MWE:

\begin{table}[ht]
\centering
\begin{tabularx}{1.0\textwidth}{|l|l|l|}
\hline
\rowcolor[HTML]{C0C0C0} 
\textbf{Step} &
  \textbf{EBSE} &
  \textbf{Correlation with current study} \\ \hline
1 &
  \begin{tabular}[c]{@{}l@{}}Converting the need for information (about\\ development and maintenance methods, management\\ procedures etc.) into an answerable question.\end{tabular} &
  What do software practitioners need to be aware when doing architectural software decisions? \\ \hline
2 &
  \begin{tabular}[c]{@{}l@{}}Tracking down the best evidence with which to answer\\ that question.\end{tabular} &
  Literature research suggests that the best way to provide answers to these questions is to investigate how these decisions are made and in what conditions. \\ \hline
3 &
  \begin{tabular}[c]{@{}l@{}}Critically appraising that evidence for its validity\\ (closeness to the truth), impact (size of the effect), and\\ applicability (usefulness in software development\\ practice).\end{tabular} &
  Survey research is one of the best methods for appraising such hypotheses and collecting information about software development practices. \\ \hline
4 &
  \begin{tabular}[c]{@{}l@{}}Integrating the critical appraisal with our software\\ engineering expertise and with our stakeholders’\\ values and circumstances.\end{tabular} &
  By combining EBSE with the survey research, we provide a formal way to investigate the current phenomena. \\ \hline
5 &
  \begin{tabular}[c]{@{}l@{}}Evaluating our effectiveness and efficiency in\\ executing Steps 1-4 and seeking ways to improve them\\ both for next time.\end{tabular} &
  Further the evaluation phase of this study, we reassess the benefits of EBSE with survey results and shed some light on future findings. \\ \hline
\end{tabularx}
\caption{Five step used in EBSE}
\label{tab:ebse-correlation}
\end{table}

table doesn't fit to page

I tried Tables Generator in order to doing things faster however now I`m stuck. Any tips for this newbie?

1
  • 3
    \begin{tabularx}{1.0\textwidth}{|l|l|l|} tabularx must have an X column, use {|l|l|X|} or better lXX and remove all the nested tabular Commented Dec 14, 2022 at 16:25

2 Answers 2

1

So, expanding on David's comment, I would remove all the breaking line macros \\, leave text as is, and let LaTeX add line breaks where necessary. For texts, you could either use regular paragraph columns p{} or X to avoid having to specify widths.

Consider adding \RaggedRight from ragged2e, which also improves texts inside narrower environments, such as tables

\documentclass{article}
\usepackage{tabularx}
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{ragged2e}
\usepackage{kantlipsum}
\begin{document}
\begin{table}[ht]
  \renewcommand*{\arraystretch}{1.35}
  \setlength\tabcolsep{4pt}
  \RaggedRight
  \centering
  \begin{tabularx}{\textwidth}{lXX}
    \hline
    \rowcolor[HTML]{C0C0C0} 
    \textbf{Step}
    & \textbf{EBSE}
    & \textbf{Correlation with current study}
    \\ \hline
    1
    & Converting the need for information (about development and maintenance methods, management procedures etc.) into an answerable question.
    & What do software practitioners need to be aware when doing architectural software decisions? \\
    \hline
    2
    & Tracking down the best evidence with which to answer that question.
    & Literature research suggests that the best way to provide answers to these questions is to investigate how these decisions are made and in what conditions. \\
    \hline
    3
    & Critically appraising that evidence for its validity (closeness to the truth), impact (size of the effect), and applicability (usefulness in software development practice).
    & Survey research is one of the best methods for appraising such hypotheses and collecting information about software development practices. \\
    \hline
    4
    & Integrating the critical appraisal with our software engineering expertise and with our stakeholders’ values and circumstances.
    & By combining EBSE with the survey research, we provide a formal way to investigate the current phenomena. \\
    \hline
    5
    & Evaluating our effectiveness and efficiency in executing Steps 1-4 and seeking ways to improve them both for next time.
    & Further the evaluation phase of this study, we reassess the benefits of EBSE with survey results and shed some light on future findings. \\
    \hline
  \end{tabularx}
  \caption{Five step used in EBSE}
  \label{tab:ebse-correlation}
\end{table}
\end{document}

enter image description here

1

In addition to using the X column type for 2 of the table's 3 columns and getting rid of the tabular wrappers, I would give the table a much more open "look" by getting rid of all vertical lines and most horizontal lines.

enter image description here

\documentclass{article}
\usepackage[english]{babel}
\usepackage{tabularx} % for "tabularx" env. and "X" col. type
\usepackage{ragged2e} % for "\RaggedRight" macro
\newcolumntype{L}{>{\RaggedRight}X} % ragged-right appearance
\usepackage{booktabs} % for well-spaced horizontal lines: \toprule, \midrule, ...

\begin{document}

\begin{table}[ht]
\setlength\tabcolsep{4pt} % default:  6pt
\begin{tabularx}{\textwidth}{@{} lLL @{}}
\toprule
Step & EBSE & Correlation with current study \\ 
\midrule
1 & Converting the need for information (about development and maintenance methods, management procedures etc.) into an answerable question. 
  & What do software practitioners need to be aware when doing architectural software decisions? \\ 
\addlinespace
2 & Tracking down the best evidence with which to answer that question. 
  & Literature research suggests that the best way to provide answers to these questions is to investigate how these decisions are made and in what conditions. \\ 
\addlinespace
3 & Critically appraising that evidence for its validity (closeness to the truth), impact (size of the effect), and applicability (usefulness in software development practice). 
  & Survey research is one of the best methods for appraising such hypotheses and collecting information about software development practices. \\ 
\addlinespace
4 & Integrating the critical appraisal with our software engineering expertise and with our stakeholders’ values and circumstances. 
  & By combining EBSE with the survey research, we provide a formal way to investigate the current phenomena. \\ 
\addlinespace
5 & Evaluating our effectiveness and efficiency in executing Steps 1--4 and seeking ways to improve them both for next time. 
  & Further the evaluation phase of this study, we reassess the benefits of EBSE with survey results and shed some light on future findings. \\ 
\bottomrule
\end{tabularx}
\caption{Five steps used in EBSE}
\label{tab:ebse-correlation}
\end{table}

\end{document}

You must log in to answer this question.

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