我想在表格出现之前引用它。TeX 代码粘贴在下面
\documentclass{article}
\begin{document}
The results given in Table~\ref{tab:a} show the performance of
the class.
\begin{table}
\begin{center}
\begin{tabular}{lrc}\hline
Name & Mark & Grade \\
\hline
Prasad & 99 & A+ \\
Prakash & 51 & C\\
Shine & 5 & F\\ \hline
\end{tabular}
\caption{Class Mark List}\label{tab:a}
\end{center}
\end{table}
\end{document}
但文字
The results given in Table~\ref{tab:a} show the performance of
the class.
位于表格之后。我怎样才能将表格放在文本之后?
答案1
请按如下方式使用:
\begin{table}[!htb]
\centering
\begin{tabular}{lrc}\hline
....
\caption{Class Mark List}\label{tab:a}
\end{table}
然而,从印刷工的角度来看,表格的标题应该位于表列上方。
答案2
\begin{table}[htdp]
\vskip 0.25cm
\begin{center}
\begin{tabular}{| c| c |c |}
\hline\hline
{\textcolor{blue}{Plasma Parameter} & {\textcolor{blue}{PIC code parameters }& { \textcolor{blue}{MHD code parameters}}&\\
\hline
{\bf B$_z$}& 0.2&6.5 (nT)\\
\hline
{\bf V$_x$}& 0.25 & 500 (km.sec$^-^1$)\\
\hline
{\bf V$_A$}& 0.028 & 63 (km.sec$^-^1$)\\
\hline
$\frac{V_{A}}{V_{SW}}$&0.11&0.12\\
\hline
{\bf M$_A$}&8.9&7.8\\
\hline
{M$_S_C$}&5.5&5.2\\
\hline
\beta&1.6&2.7\\
\hline
\end{tabular}
\end{center}
\caption{ PIC and MHD simulations}\label{Tab:1}
\end{table}