Due to a recommendation on this board, I have decided to use pgfplotstable in my lab reports to import data from a CSV and print it out as a table in LaTeX. However, in a section such as my appendices, I need tables to be under headings (not above them), so how can I force LaTeX to place the table where I put it in my code.
Sample:
\appendix
\appendixpage
\section{Tables}
\begin{subappendices}
\subsection{Heading 1}
\pgfplotstableread{mydata.csv}{\mydatalabel}
\begin{table}
\centering
\caption[LoT Caption]{Full Caption}
\pgfplotstabletypeset[%
every head row/.style={
before row=\toprule, after row=\midrule},
every last row/.style={
after row=\bottomrule},
]{\mydatalabel}
\label{table:mydatalabel}
\end{table}
LaTeX will do its automatic formatting and place my tables above Heading 1 (and other headings too).
Before the use of pgfplotstables, I used this code for my tables to force them where they are meant to be:
\begin{center}
\captionof{table}[LoT Caption]{Full Caption}
\begin{tabular}{c c c c}
\toprule
\bottomrule
\label{table:mydatalabel} \\
\end{tabular}
\end{center}
Is there something similar I can do? I really like using pgfplotstables so far since I don't have to manually enter data into tables anymore

\begin{tabular}...\end{tabular}with\pgfplotstabletypeset[...]{...}in your last code snippet. The\label{}does not need to be inside thetabularenvironment: as long as it comes after\captionit's fine. – Paul Gessler Feb 18 '15 at 22:35tableenvironment see http://tex.stackexchange.com/questions/2275/keeping-tables-figures-close-to-where-they-are-mentioned – David Carlisle Feb 18 '15 at 22:39