LaTeX forum ⇒ GeneralLaTeX table floating problem

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

LaTeX table floating problem

Postby praveen25488 » Thu Feb 28, 2019 6:28 am

Table unnecessarily floats to next page. I want it to be placed where it is specified.
  1. \renewcommand{\familydefault}{\sfdefault}
  2. \usepackage{multirow}
  3. \usepackage{graphicx}
  4. \usepackage[scaled=1]{helvet}
  5. \usepackage[helvet]{sfmath}
  6. \usepackage{graphicx}
  7. \setcounter{chapter}{0}
  8. \frontmatter
  9. \usepackage{multicol}
  10. \setlength{\columnsep}{1cm}
  11. \begin{document}
  12. \chapter{Exponents}
  13. \begin{multicols}{2}
  14. \renewcommand{\theenumii}{\Alph{enumii}}
  15. \begin{enumerate}
  16. \item
  17. \begin{table*}[!htbp]
  18. \begin{tabular}{cc|c|c|c|c}
  19. \cline{3-5}
  20. & & \multicolumn{3}{c|}{Course} &
  21. \\ \cline{3-6}
  22. & & Algebra I & Geometry & Algebra II & \multicolumn{1}{c|}
  23. {Total} \\ \hline
  24. \multicolumn{1}{|c|}{\multirow{2}{*}{Gender}} & Female & 35 & 53 & 62 & \multicolumn{1}{c|}{150} \\ \cline{2-6}
  25. \multicolumn{1}{|c|}{} & Male & 44 & 59 & 57 & \multicolumn{1}{c|}{160} \\ \hline
  26. \multicolumn{2}{|c|}{Total} & 79 & 112 & 119 & \multicolumn{1}{c|}{310} \\ \hline
  27. \end{tabular}
  28. \end{table*}
  29. A group of tenth-grade students responded to a survey that asked which math
  30. course they were currently enrolled in. The survey data were broken down as
  31. she able above. Which of the following categories accounts for approximately
  32. 19 percent of all the survey respondents?
  33. \begin{enumerate}
  34. \item Females taking Geometry
  35. \item Females taking Algebra II
  36. \item Males taking Geometry
  37. \item Males taking Algebra I
  38. \end{enumerate}
  39. \item
  40. Which of the following expressions is equivalent to
  41. $ \sqrt[3]{a}\cdot a \cdot \sqrt[5]{a^2} $ for $a > 0$ ?
  42. \\
  43. \begin{enumerate}
  44. \item $a^\frac{2}{15}$\\
  45. \item $a^\frac{6}{15}$\\
  46. \item $a^\frac{11}{15}$\\
  47. \item $a^\frac{26}{15}$\\
  48. \end{enumerate}
  49. \item
  50. $$ \sqrt{16y^2} $$
  51. If $x>0$, which of the following is equivalent to the given expression?\\
  52. \begin{enumerate}
  53. \item $4y$\\
  54. \item $4y^2$\\
  55. \item $32y$\\
  56. \item $32y^2$\\
  57. \end{enumerate}
  58. \end{enumerate}
  59. \end{multicols}
  60. \end{document}

User avatar
Stefan Kottwitz
Site Admin
Posts: 9327
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Thu Feb 28, 2019 1:37 pm

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.

  1. \begin{enumerate}
  2. \item
  3. \begin{tabular}{cc|c|c|c|c}
  4. \cline{3-5}
  5. & & \multicolumn{3}{c|}{Course} &
  6. \\ \cline{3-6}
  7. & & Algebra I & Geometry & Algebra II & \multicolumn{1}{c|}
  8. {Total} \\ \hline
  9. \multicolumn{1}{|c|}{\multirow{2}{*}{Gender}} & Female & 35 & 53 & 62 & \multicolumn{1}{c|}{150} \\ \cline{2-6}
  10. \multicolumn{1}{|c|}{} & Male & 44 & 59 & 57 & \multicolumn{1}{c|}{160} \\ \hline
  11. \multicolumn{2}{|c|}{Total} & 79 & 112 & 119 & \multicolumn{1}{c|}{310} \\ \hline
  12. \end{tabular}
  13. ...


Stefan
Site admin


Return to “General”

Who is online

Users browsing this forum: No registered users and 6 guests