Your habit of encasing the contents of almost every cell in a single-column tabular
environment, with column type l
, is preventing automatic line breaking from occurring. The remedy? Get rid of the tabular
wrappers.
Oh, and do employ a tabularx
environment and the L
column type you've already defined for columns 2 thru 4. I can see no reason for \scriptsize
; in the code below, I employ \small
. Finally, there's no compelling reason for bold-facing the contents of the header cells, is there?
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/adxnM.png)
\documentclass{sn-jnl}
\usepackage{tabularx,ragged2e}
\newcolumntype{L}{>{\RaggedRight}X}
\begin{document}
\begin{table}[h]
\setlength\extrarowheight{2pt} % for a less cramped look
\setlength\tabcolsep{4pt} % default: 6pt
\small % why "\scriptsize" ?
\caption{}
\label{table:Literature}
\begin{tabularx}{\textwidth}{|l|L|L|L|}
\hline
Item & Actions & Proposition & Outcome \\
\hline
Work-1
& Modification in group formation for set creation.
Removes all irrelevant and invisible users from list.
& Claims increase in size by reducing parameter number one.
& It's not clear what the author wants to achieve from
this research.
\\ \hline
\end{tabularx}
\end{table}
\end{document}
Addendum to address the OP's follow-up comment: Since the solution shown above employs a table
float, it can occupy at most a full page. If your table's length (including caption) exceeds the \textheight
parameter, I suggest you proceed by switching from a combined table
/tabularx
framework to a xltabular
framework. Basically, an xltabular
environment combines the capabilities of the longtable
and tabularx
environments.
You have also expressed a desire to be able to set unequal column widths.
To do so by specifying relative rather than absolute column widths, I suggest to generalize the L
column type (which, itself, is a generalization of the X
column type) that's defined in your code to allow for unequal relative widths.
In the code below, this is done by specifying the Y
column type, which differs from the L
column type by taking an explicit argument. The main rule to remember is that the relative column widths have to sum up to the number of Y
-type columns.
You've mentioned wanting to use absolute (usable) widths of 2cm, 3cm, 3cm, and 4cm; that's a ratio of 2:3:3:4. A quick calculation shows that the arguments of the 4 Y
columns should be 0.667, 1, 1, and 1.333. Why? It's because (a) 1.333 is 33.3% larger than 1 and twice as large as 0.667, and (b) 0.667+1+1+1.333 = 4 = number of Y
-type columns.
To sum up: use
\begin{xltabular}{\textwidth}{|Y{0.667}|Y{1}|Y{1}|Y{1.333}|}
instead of
\begin{tabularx}{\textwidth}{|l|L|L|L|}
Just to provide an additional example of how to derive the arguments of the Y
columns: Suppose that instead of employing the Y
column type for all 4 columns with a ratio of 2:3:3:4
, you decide to employ the l
column type for the first column, while still assigning a 3:3:4 ratio to the remaining 3 columns. A quick calculation shows that you should now write
\begin{xltabular}{\textwidth}{|l|Y{0.9}|Y{0.9}|Y{1.2}|}
because 1.2 is 33.3% larger than 0.9 and 0.9+0.9+1.2 = 3 = # of Y-type columns.
The following screenshot shows how the two approaches differ in appearance.
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/iIcP4.jpg)
\documentclass{sn-jnl}
\usepackage{xltabular} % For 'xltabular' env. Loads the 'tabularx'
% and 'longtable' packages automatically
\usepackage{ragged2e} % For '\RaggedRight' macro
\newcolumntype{L}{>{\RaggedRight}X}
\newcolumntype{Y}[1]{>{\RaggedRight\hsize=#1\hsize}X}
\begin{document}
%% Version 1: table/tabularx (repeated from above)
\begin{table}[h]
\setlength\tabcolsep{4pt} % default: 6pt
\setlength\extrarowheight{2pt} % for a less cramped look
\caption{}
\label{table:Literature_1}
\small
\begin{tabularx}{\textwidth}{|l|L|L|L|}
\hline
Item & Actions & Proposition & Outcome \\
\hline
Work-1
& Modification in group formation for set creation.
Removes all irrelevant and invisible users from list.
& Claims increase in size by reducing parameter number one.
& It's not clear what the author wants to achieve from
this research.
\\ \hline
\end{tabularx}
\end{table}
%% Version 2: xltabular approach
\begingroup % Limit the scope of the next 3 instructions
\setlength\tabcolsep{4pt} % default: 6pt
\setlength\extrarowheight{2pt} % for a less cramped look
\small
\begin{xltabular}{\textwidth}{|Y{0.667}|Y{1}|Y{1}|Y{1.333}|}
%% headers and footers
\multicolumn{4}{@{}l}{\refstepcounter{table}\textbf{Table \thetable} \label{table:Literature_1a}}
\\[1.5ex]
\hline
Item & Actions & Proposition & Outcome \\
\hline
\endfirsthead
\multicolumn{4}{@{}l}{\textbf{Table \thetable}, cont'd} \\[1.5ex]
\hline
Item & Actions & Proposition & Outcome \\
\hline
\endhead
\multicolumn{4}{r@{}}{\footnotesize\em(continued on next page)}\\
\endfoot
\hline
\endlastfoot
%% body of table
Work-1
& Modification in group formation for set creation.
Removes all irrelevant and invisible users from list.
& Claims increase in size by reducing parameter number one.
& It's not clear what the author wants to achieve from
this research. \\ % note: no \hline directive here
\end{xltabular}
\endgroup
\end{document}