0

I would like to add a table with a caption to my document. (Somewhere in the middle of my article) However, every time I add a caption, it moves the table to the very beginning (top) of the document. Could you please advise me what I'm doing wrong? Thank you very much.

The code looks like this:

\ begin {table}
   \ centering
\ begin {tabular} {| c | c | c | c |}
\ hline
\ textbf {status} & \ textbf {n} & \ textbf {prev} & \ textbf {\%} \\
Lower & 9 & 7 & 77.78 \\
\ hline
Medium & 109 & 88 & 80.73 \\
\ hline
Higher & 11 & 7 & 63.64 \\
 \ end {tabular}
\ caption {Table no. 1}
\ end {table}

Table without caption Table, when I add a caption

David Carlisle
  • 757,742
  • Welcome to TSE. Please post a Minimal Working Example, instead of a code snippet. – José Carlos Santos Sep 26 '21 at 09:08
  • 1
    You're doing nothing wrong. The table environment is meant to float, LaTeX puts it at a viable position according to the parameters that were set (which is a good thing, just sometimes surprising for new users). A short explanation regarding floats can be found at LearnLaTeX (this discusses figure but is essentially the same). An exhaustive explanation of LaTeX's float mechanism can be found here: https://tex.stackexchange.com/questions/39017/how-to-influence-the-position-of-float-environments-like-figure-and-table-in-lat – Skillmon Sep 26 '21 at 09:10
  • 1
    note it is the table environment that allows the table to move: the caption doesn't affect positioning other than by making the table bigger it may alter the places where the table fits. – David Carlisle Sep 26 '21 at 09:17

0 Answers0