Document Classes ⇒ Positioning of tables
Positioning of tables
I have a question about positioning of tables.
Why is a table on an otherwise empty page placed in the middle of the page and not at the top as I try to do with [ht] ?
How can I change this behaviour?
Conny
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
Positioning of tables
Code: Select all
\makeatletter
\setlength\@fptop{0pt}
\setlength\@fpsep{20pt plus 2pt minus 2pt}
\setlength\@fpbot{0pt}
\makeatother
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Positioning of tables
those values will probably work if there's just one table at the page and perhaps will produce a warning "underfull \vbox".
If there are two tables, one will be positioned at the top and one at the bottom, because of the value 0pt for \@fpbot and the stretchability of \@fpsep.
I think its better not to change \@fpbot, it could keep its default value 0pt+1fil, so the tables will go up to the top of the page. Further there will be no warning about the underfull \vbox.
Stefan
Re: Positioning of tables
\makeatletter
\setlength\@fptop{0pt}
\setlength\@fpsep{20pt plus 2pt minus 2pt}
\setlength\@fpbot{0pt}
\makeatother
one is at the top and one at the bottom. This remains when I remove the "fpsep" line. When I just put
\makeatletter
\setlength\@fptop{0pt}
\makeatother
the second table is somewhere in the middle of the page. I dont have the problem with the two tables right now, but how would I fix that?
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Positioning of tables
I meant \@fpbot above, that should not be changed, I've corrected it.
So try:
Code: Select all
\makeatletter
\setlength\@fptop{0pt}
\setlength\@fpsep{20pt plus 2pt minus 2pt}
\makeatother
Re: Positioning of tables

now it works! Thanks!