GeneralLaTeX table floating problem

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
praveen25488
Posts: 3
Joined: Mon Sep 25, 2017 7:35 am

LaTeX table floating problem

Post by praveen25488 »

Table unnecessarily floats to next page. I want it to be placed where it is specified.

Code: Select all

\renewcommand{\familydefault}{\sfdefault}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage[scaled=1]{helvet}
\usepackage[helvet]{sfmath}
\usepackage{graphicx}
\setcounter{chapter}{0}
\frontmatter
\usepackage{multicol}
\setlength{\columnsep}{1cm}
\begin{document}
\chapter{Exponents}
\begin{multicols}{2}
\renewcommand{\theenumii}{\Alph{enumii}}
\begin{enumerate}
\item
\begin{table*}[!htbp]
\begin{tabular}{cc|c|c|c|c}
    \cline{3-5}
    &        & \multicolumn{3}{c|}{Course}       &                            
   \\ \cline{3-6} 
    &        & Algebra I & Geometry & Algebra II & \multicolumn{1}{c|} 
{Total} \\ \hline
    \multicolumn{1}{|c|}{\multirow{2}{*}{Gender}} & Female & 35        & 53       & 62         & \multicolumn{1}{c|}{150}   \\ \cline{2-6} 
    \multicolumn{1}{|c|}{}                        & Male   & 44        & 59       & 57         & \multicolumn{1}{c|}{160}   \\ \hline
    \multicolumn{2}{|c|}{Total}                            & 79        & 112      & 119        & \multicolumn{1}{c|}{310}   \\ \hline
\end{tabular}
\end{table*}
A group of tenth-grade students responded to a survey that asked which math 
course they were currently enrolled in. The survey data were broken down as 
she able above. Which of the following categories accounts for approximately 
19 percent of all the survey respondents?
\begin{enumerate}
\item   Females taking Geometry
\item   Females taking Algebra II
\item   Males taking Geometry
\item   Males taking Algebra I
\end{enumerate}
\item
Which of the following expressions is equivalent to 
$ \sqrt[3]{a}\cdot a \cdot \sqrt[5]{a^2} $  for $a > 0$ ? 
\\
\begin{enumerate}
\item $a^\frac{2}{15}$\\
\item $a^\frac{6}{15}$\\
\item $a^\frac{11}{15}$\\
\item $a^\frac{26}{15}$\\
\end{enumerate}
\item
$$ \sqrt{16y^2} $$  
If $x>0$, which of the following is equivalent to the given expression?\\
\begin{enumerate}
\item $4y$\\
\item $4y^2$\\
\item $32y$\\
\item $32y^2$\\
\end{enumerate}
\end{enumerate}
\end{multicols}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

LaTeX table floating problem

Post by Stefan Kottwitz »

Welcome to the forum!

In that case, simply don't use a table environment. It is for floating, captions, and labeling/referencing, and you don't use anything of that, so you can easily omit it. tabular works fine without table.

Code: Select all

\begin{enumerate}
\item
\begin{tabular}{cc|c|c|c|c}
    \cline{3-5}
    &        & \multicolumn{3}{c|}{Course}       &                            
   \\ \cline{3-6} 
    &        & Algebra I & Geometry & Algebra II & \multicolumn{1}{c|} 
{Total} \\ \hline
    \multicolumn{1}{|c|}{\multirow{2}{*}{Gender}} & Female & 35        & 53       & 62         & \multicolumn{1}{c|}{150}   \\ \cline{2-6} 
    \multicolumn{1}{|c|}{}                        & Male   & 44        & 59       & 57         & \multicolumn{1}{c|}{160}   \\ \hline
    \multicolumn{2}{|c|}{Total}                            & 79        & 112      & 119        & \multicolumn{1}{c|}{310}   \\ \hline
\end{tabular}
...
Stefan
LaTeX.org admin
Post Reply