\section{Main section}
\subsection{Some subsection}
\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{lllll}
x & y & z & a & \\
0 & 0 & 0 & 0 & \\
0 & 0 & 0 & 0 & \\
0 & 0 & 0 & 0 &
\end{tabular}
\end{table}
Test text test text.
For some reason this table is shows up before "Main section" even though I typed it after the section header. What is the reason for this?
tableenvironment and use\captionof{table}{...}instead of\caption{...}, this requires thecaptionpackage (which is a good idea anyway) – Dec 27 '15 at 21:32\begin{table}[!htb]– Dec 27 '15 at 21:32\begin{table}[h]is enough in this case. – Alenanno Dec 27 '15 at 21:34figureandtableare the basic floating environments. Other packages define new ones or with the packagefloatthere will be new floats available, if really needed. I suggest to read an introductory book onLaTeX. – Dec 27 '15 at 21:37hmeans "here". If you addtb, it can be placed at the top of the current page (or next page) or at the bottom of the current page (or next page). – Alenanno Dec 27 '15 at 21:38[h]is automatically changed into[ht]– egreg Dec 27 '15 at 21:43latex.ltxalready, so it's no special invention of a class. I think it's the same for all standard classes, but maybe I am wrong. Do you have an example? – Dec 27 '15 at 21:50