3

So, for an assignment in one of my classes, we are supposed to provide some data in the form of tables. So, what I want to do is put my tables under a certain number of subsections, but when I do this:

\section*{Test Results}
Below are the results for each tester.
\subsection*{Tester 1}
\begin{table}[H]
\begin{tabular}{|p{2.5cm}|p{2.5cm}|p{2.5cm}|p{2.5cm}|}
\hline
Safari&Print&Set Homepage&Zoom\\
\hline
Time(Seconds)&40&32&20\\
\hline
Errors&Couldn't find the print button&Clicked the wrong menu button&N/A\\
\hline
Likeability(1 to 10)&6&7&8\\
\hline
\end{tabular}
\vspace{-2em}
\begin{tabular}{|p{2.5cm}|p{2.5cm}|p{2.5cm}|p{2.5cm}|}
\hline
Opera&Print&Set Homepage&Zoom\\
\hline
Time(Seconds)&37&226 (3 mins. 46 secs.)&17\\
\hline
Errors&Couldn't find the print button/No Confirmation of print&Opened Chrome to learn how to set an Opera Page/Difficult to find preferences&Mis-clicked on Zoom button.\\
\hline
Likeability(1 to 10)&6&0&7\\
\hline
\end{tabular}
\end{table}
\subsection*{Tester 2}
\begin{table}[]
\begin{tabular}{|p{2.5cm}|p{2.5cm}|p{2.5cm}|p{2.5cm}|}
\hline
Safari&Print&Set Homepage&Zoom\\
\hline
Time(Seconds)&8&22&32\\
\hline
Errors&N/A&Found it difficult to change home page in settings.&Had a hard time finding zoom button.\\
\hline
Likeability(1 to 10)&8&7&5\\
\hline
\end{tabular}
\end{table}
\begin{table}
\begin{tabular}{|p{2.5cm}|p{2.5cm}|p{2.5cm}|p{2.5cm}|}
\hline
Opera&Print&Set Homepage&Zoom\\
\hline
Time(Seconds)&5&338 (5 mins. 38 secs.)&8\\
\hline
Errors&N/A&Couldn't find out how to make a home page/Googled the results, looked in various places to learn how to set the web page.&N/A\\
\hline
Likeability(1 to 10)&6&0&7\\
\hline
\end{tabular}
\end{table}

My document produces the subsections before my tables. Is there anyway I can get my data under their respective subsections?

JCMcRae
  • 133
  • Have you tried loading the placeins package and inserting \FloatBarrier instructions before the \subsection instructions? – Mico Nov 02 '14 at 22:12
  • Welcome to TeX.SE. You could add a \clearpage before the \subsection. Also, while code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill Nov 02 '14 at 22:12
  • 1
    You don't have to use a table in order to use a tabular. Just use {\centering \begin{tabular}... \end{tabular}\par}. – Werner Nov 02 '14 at 22:16

1 Answers1

3

A combination of (a) using [h!] as the location specifier and (b) inserting \clearpage immediately before the second \subsection* instruction should do the job. Incidentally, since you have four tabular environments, you should provide four (not three) table environments. Better still, since the tables aren't supposed to float anyway, don't use any table environments.

Mico
  • 506,678