section title appears after the table [duplicate]

I'm writing a homework report in the environment article and I want to include a table in the result section, my code looks like this

\newpage
\section*{Result}
\begin{table}
\begin{tabular}{m{1.5cm} m{3cm} m{3cm} m{3cm} m{3cm}}
\hline
t & Approx. Solution J=1 & Approx. Solution J=3 & Approx. Solution J=5 & Exact Solution\\
\hline
0.00 & 1.500 & 1.500 & 1.500 & 1.500\\
0.02 & 1.314 & 1.347 & 1.338 & 1.341\\
0.04 & 1.162    &1.199&1.191&1.194\\
0.06& 1.037 &1.075 &1.067 &1.071\\
0.08&0.935&0.973&0.965  &0.969\\
0.10    &0.851  &0.889  &0.881  &0.885\\
0.12    &0.782  &0.820  &0.812  &0.816\\
0.14    &0.725  &0.764  &0.755  &0.759\\
0.16    &0.679  &0.717  &0.709  &0.713\\
0.18    &0.641  &0.679  &0.671  &0.675\\
0.20    &0.610  &0.648  &0.640  &0.643\\
\hline
\end{tabular}
\caption{Result of Running the Code Attached}
\end{table}
Exactly the same as Table 5.13 in the textbook.


Clearly I wrote section* before \begin{table} but the output looks like this

any suggestion would be much appreciated!

marked as duplicate by user31729, Torbjørn T., Martin Schröder, Mico tables StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Feb 21 '17 at 12:59

• Welcome to TeX.SE. Your table environment floats away. If you don't want this, omit the table environment, replace \caption with \captionof{table} and load the caption package; or use \begin{table}[htpb]...\end{table}. We have this question about 5 times a day and the answer is always the same ;-) – user31729 Feb 21 '17 at 8:58
• @ChristianHupfer thank you for your help! after a quick glance of the link u just posted, i was able to fix my problem by using \begin{table}[h!]. thank you again! – Jack Wen Feb 21 '17 at 9:12