[Tex/LaTex] Table position at Top Problem

positioningtablesvertical alignment

I am trying to place my table at the top of page but it seems there is something I am missing. First of all here is what my document structure

\documentclass{article}
\begin{document}
\section{Introduction}
4 long paragraphs which take exactly one page with this document class.
% Now the actual table starts
\begin{table}
\centering
\caption{Vertical Alignment Test}
\begin{tabular}[t]{ |m{0.85\textwidth}|c| } \hline
Somewhat 20 rows for this table
\end{tabular}
\end{table}
% Table end here
Immediately after table, Same 4 long paragraphs are copied but without \section.
\end{document}

This results in following output document structure

  • Page-1: 4 paragraphs
  • Page-2: Vertically center aligned table
  • Page-3: 4 paragraphs

Problem:
Now my table is not as much long that it should take complete page rather if aligned properly at top of page, 2 paragraphs from bottom can be adjusted on page-2.

Tried Solutions

Here is somewhat related question which discusses the same problem. I tried to understand accepted answer and applied given solutions but no luck.

I tried to move table between paragraphs but it didn't change on output file mean same structure keep on outputting i.e. 4 paragraphs -> table -> 4 paragraphs

I cut some rows and at about half of rows (10) table get positioned at top and I get the effect what I wanted. But I don't want 10 rows I want all 20 rows in one table.

Please let me know if there are any questions regarding my explanation.

Best Answer

Just to close this off

You have to give the position specifiers to the table environment. It is preferrable to give [htb] instead of [!t] so that latex has some room to improve the appearence.

\documentclass{article}
\usepackage{array,kantlipsum}
\begin{document}
\kant[1-4]
\begin{table}[htb]   %%<<--- give it here
\centering
\caption{Vertical Alignment Test}
\begin{tabular}[t]{ |m{0.85\textwidth}|c| } \hline
Somewhat 20 rows for this table
\end{tabular}
\end{table}
\kant[1-5]
\end{document}

enter image description here