Warm tip: This article is reproduced from serverfault.com, please click

LaTeX orders table before text even if in the code the table is after text. Why?

发布于 2020-12-02 22:51:48

This code:

\subsection*{4.1 1NF}
No, this table is not in 1NF as column Info can and on multiple rows hold multiple values. 1NF Variation would be:
\par
\begin{table}[]
\begin{tabular}{|l|l|l|l|l|l|}
\hline
{\ul \textbf{Student\_ID}} & \textbf{First Name} & \textbf{Last Name} & \textbf{Course} & \textbf{Credits} & \textbf{Grade} \\ \hline
1                          & Adam                & Brown              & Databases       & 5                & 8              \\ \hline
1                          & Adam                & Brown              & Algebra         & 3                & 7              \\ \hline
1                          & Adam                & Brown              & Algorithms      & 5                & 9              \\ \hline
2                          & Felicia             & Green              & Algebra         & 3                & 10             \\ \hline
2                          & Felicia             & Green              & Programming     & 5                & 6              \\ \hline
3                          & Mary                & Grey               & Databases       & 5                & 9              \\ \hline
3                          & Mary                & Grey               & Algorithms      & 5                & 7              \\ \hline
3                          & Mary                & Grey               & Web             & 3                & 10             \\ \hline
1                          & Adam                & Brown              & Physics         & 3                & 10             \\ \hline
\end{tabular}
\end{table}

Produces this result:

Rednder of the LaTeX code above

But I need the table to be after the text.

Can someone tell me what am I doing wrong?

Questioner
Lukáš Kaufmann
Viewed
0
samcarter_is_at_topanswers.xyz 2020-12-03 07:06:28

You're missing a floating specifier, e.g. to allow the table [h]ere, at the [t]op, at the [b]ottom or on a separate [p]age:

\begin{table}[htbp]