GeneralTable keeps appearing bottom of page

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
ma501th
Posts: 50
Joined: Tue Apr 08, 2008 7:31 pm

Table keeps appearing bottom of page

Post by ma501th »

Hi,

Can you please help me. Every time i create a simple table it keeps appearing at the bottom of the page i really dont know why.

This is my complete latex coding:

\documentclass[openany,a4paper,10pt]{book}

\usepackage{times,a4wide}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}
\usepackage[round]{natbib}

\title{My Project Report}
\author{James Allen\\Supervisor: Dr R Kibble}
\date{\today} % Activate to display a given date or no date
% Activate to display a given date or no date
\begin{document}
\maketitle
\def\thepage{\arabic{page}}

\tableofcontents
\listoftables
\chapter{Introduction}

\begin{table}
\begin{center}
\begin{tabular}{ | l | l | }
\hline
Test No & \\ \hline
Input & \\ \hline
Result & \\ \hline
Conclusion & \\
\hline
\end{tabular}
\caption{Test 2}
\label{tb:Test 2}
\end{center}
\end{table}

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

ma501th
Posts: 50
Joined: Tue Apr 08, 2008 7:31 pm

Re: Table keeps appearing bottom of page

Post by ma501th »

dont worry guys i figured it out

\usepackage{float} - this was required as a package

[H] - this was required beside the table to indicate the position.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Table keeps appearing bottom of page

Post by gmedina »

Please. let me worry.

Code: Select all

\documentclass[openany,a4paper,10pt]{book}
%obsolete packages (read l2tabu document)
\usepackage{times,a4wide}
%%%%%%%%%%%%
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
%use it at your own risk
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}
%%%%%%%%%%%%%%
\usepackage[round]{natbib}

\title{My Project Report}
\author{James Allen\\Supervisor: Dr R Kibble}
\date{\today} % Activate to display a given date or no date
% Activate to display a given date or no date
\begin{document}
\maketitle
\def\thepage{\arabic{page}}
%I would suggest
\renewcommand{\thepage}{\arabic{page}}

\tableofcontents
\listoftables
\chapter{Introduction}

\begin{table}[!ht]
  \centering
  \begin{tabular}{|l|l|}
  \hline
  Test No & \\ \hline
  Input & \\ \hline
  Result & \\ \hline
  Conclusion & \\
  \hline
  \end{tabular}
  \caption{Test 2}
  \label{tb:Test 2}
\end{table}

\end{document}
Remarks: 1) Usually, using !ht would be enough.
2) Read the l2tabu document.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply