Document ClassesPositioning of tables

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
c0nny
Posts: 10
Joined: Sat Jun 28, 2008 12:28 pm

Positioning of tables

Post by c0nny »

Hi,

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

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

l0calh05t
Posts: 19
Joined: Fri Jul 04, 2008 2:57 pm

Positioning of tables

Post by l0calh05t »

try adding

Code: Select all

Code, edit and compile here:
\makeatletter
\setlength\@fptop{0pt}
\setlength\@fpsep{20pt plus 2pt minus 2pt}
\setlength\@fpbot{0pt}
\makeatother
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
in the preamble
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: Positioning of tables

Post by Stefan Kottwitz »

Hi,

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
LaTeX.org admin
c0nny
Posts: 10
Joined: Sat Jun 28, 2008 12:28 pm

Re: Positioning of tables

Post by c0nny »

Thanks, the table is now at the top of the page. I then added another table to this page and with

\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?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Positioning of tables

Post by Stefan Kottwitz »

Hi c0nny,

I meant \@fpbot above, that should not be changed, I've corrected it.
So try:

Code: Select all

Code, edit and compile here:
\makeatletter
\setlength\@fptop{0pt}
\setlength\@fpsep{20pt plus 2pt minus 2pt}
\makeatother
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Stefan
LaTeX.org admin
c0nny
Posts: 10
Joined: Sat Jun 28, 2008 12:28 pm

Re: Positioning of tables

Post by c0nny »

sure, sorry, I wasn't concentrating ;)

now it works! Thanks!
Post Reply