How to prevent tables from jumping to the next section

floatstables

How do prevent tables from jumping to the next section? in this example, tables 2 and 3 should belong to section 1 but they jump to section 2 which is irrelevant to that section. Please note this is a two-column latex template and the tables are big, so they need to span both columns. Here is my code:

\documentclass[default,iicol]{sn-jnl}% Default with double column layout
\jyear{2021}%



%\usepackage{float}
\usepackage{tabularx}
\usepackage{array, makecell}
\usepackage{cuted}
\usepackage{stfloats} 
%\usepackage{dblfloatfix}
\usepackage{lipsum}
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
%\usepackage{kantlipsum}


\begin{document}



\section{sec1}\label{sec1}
\lipsum[1-2]


%% TABLE 1
\begin{table*}[b]
\begin{center}
 \caption{TABLE 1}
\label{Tab1}
\begin{tabular}{|c|c|c|c|c|c|}
\hline 
name & job & title & age & address & status \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
\end{tabular}
\end{center}
\end{table*}

\lipsum[2-7]



%% TABLE 2
\begin{table*}[b]
\begin{center}
 \caption{TABLE 2}
\label{Tab2}
\begin{tabular}{|c|c|c|c|c|c|}
\hline 
name & job & title & age & address & status \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
\end{tabular}
\end{center}
\end{table*}


 %% TABLE 3
\begin{table*}[b]
\begin{center}
 \caption{TABLE 3}
\label{Tab3}
\begin{tabular}{|c|c|c|c|c|c|}
\hline 
name & job & title & age & address & status \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\ 
\hline 
\end{tabular}
\end{center}
\end{table*}

%-------------------------------------------------------------------------

\section{sec2}\label{sec2}

\lipsum[1-2]

    \end{document}

enter image description here

Best Answer

  • Tables in table* floats always appear on the top of the next page from where is inserted.
  • Why you use table* environment (which span over both columns), when your showed table can be nicely fit in one column?
\documentclass[default,iicol]{sn-jnl}% Default with double column layout

\usepackage{tabularx}
\usepackage{array, makecell}
\usepackage{cuted}
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}

\usepackage{lipsum}
\begin{document}


%% TABLE 8
\begin{table}
\centering
\caption{the jumping table}
\label{Jump}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
Parameter & help & me & with & this & table \\
\hline
$IMO$ & 1 \% & 2 \% & 3 \% & 4 \% & 5\% \\
\hline
$IMO$ & 1 \% & 2 \% & 3 \% & 4 \% & 5\% \\
\hline
$IMO$ & 1 \% & 2 \% & 3 \% & 4 \% & 5\% \\
\hline
$IMO$ & 1 \% & 2 \% & 3 \% & 4 \% & 5\% \\
\hline
$IMO$ & 1 \% & 2 \% & 3 \% & 4 \% & 5\% \\
\hline
$IMO$ & 1 \% & 2 \% & 3 \% & 4 \% & 5\% \\
\hline
\end{tabular}
\end{table}
\lipsum
\end{document}

enter image description here

Addendum (1): Apparently OP table is so big, that it need to span both columns,. In this case may be of help package stfloats which enable to put table at bottom or to top of the same page where it is inserted:

\documentclass[default,iicol]{sn-jnl}% Default with double column layout

\usepackage{tabularx}
\usepackage{array, makecell}
\usepackage{stfloats}   % <-------
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}

\usepackage{lipsum}
\begin{document}
\lipsum[1-2]

%% TABLE 8
\begin{table*}[b]
\centering
\caption{the jumping table}
\label{Jump}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
Parameter & help & me & with & this & table \\
\hline
$IMO$ & 1 \% & 2 \% & 3 \% & 4 \% & 5\% \\
\hline
$IMO$ & 1 \% & 2 \% & 3 \% & 4 \% & 5\% \\
\hline
$IMO$ & 1 \% & 2 \% & 3 \% & 4 \% & 5\% \\
\hline
$IMO$ & 1 \% & 2 \% & 3 \% & 4 \% & 5\% \\
\hline
$IMO$ & 1 \% & 2 \% & 3 \% & 4 \% & 5\% \\
\hline
$IMO$ & 1 \% & 2 \% & 3 \% & 4 \% & 5\% \\
\hline
\end{tabular}
\end{table*}
\lipsum[2-7]
\end{document}

enter image description here

**Addendum (2):

  • you should set table* positioning accordingly. In the case showed in the edited question, an MWE can be:
\documentclass[default,iicol]{sn-jnl}% Default with double column layout
\usepackage{makecell, tabularx}
\usepackage{stfloats}
\usepackage{lipsum}

\begin{document}
\section{sec1}\label{sec1}
\lipsum[1-2]

%% TABLE 1
\begin{table*}[b]   % <---
\centering
\caption{TABLE 1}
\label{Tab1}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
name & job & title & age & address & status \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
\end{tabular}
\end{table*}

\lipsum[2-7]

%% TABLE 2
\begin{table*}[t]
\centering
\caption{TABLE 2}
\label{Tab2}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
name & job & title & age & address & status \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
\end{tabular}
\end{table*}

%% TABLE 3
\begin{table*}[t]
\centering
\caption{TABLE 3}
\label{Tab3}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
name & job & title & age & address & status \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols & Ida Nichols \\
\hline
\end{tabular}
\end{table*}

\section{sec2}\label{sec2}
\lipsum[1]
\end{document}

enter image description here