Graphics, Figures & Tablestable position in the text or end of document

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
cfdprogrammer
Posts: 6
Joined: Sun Apr 19, 2009 4:58 pm

table position in the text or end of document

Post by cfdprogrammer »

Hi there everyone,

I am trying to have a table set in the position in the text where I am use it.

I post my environment below; what should I change/add in the header of my latex file to have the tabular within the text and not sent to the end of the document?

Thank you very much in advance
All the best
S.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage{geometry}              
\usepackage[parfill]{parskip}    
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}

\parindent0em

\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}

\title{ TITLE}
\author{author}

\begin{document}
\maketitle
\newpage
\tableofcontents

\section{A table section}

\begin{table}[H]
\caption{captionhere}
\begin{center}
\begin{tabular}{lc c  c c c }
\hline\hline
\\
hello1   & hello2 & hello3 & hello4 & hello5\\
\hline\\
string1 	& string2 & string3 &  string4 &  string5 \\
string1  & string2 & string3 &  string4 &  string5 \\

\hline
\hline
\end{tabular}
\end{center}
\label{entries}
\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.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

table position in the text or end of document

Post by localghost »

cfdprogrammer wrote:[...] I am trying to have a table set in the position in the text where I am use it. [...]
Start with using appropriate specifiers in the option list for the table environment.

Code: Select all

\begin{table}[!ht]
  % Table contents
\end{table}
As very last measure you can use the [H] specifier provided by the float package. You are already using it, but without loading the package.


Best regards
Thorsten¹
cfdprogrammer
Posts: 6
Joined: Sun Apr 19, 2009 4:58 pm

Re: table position in the text or end of document

Post by cfdprogrammer »

Hi Thorsten,

Thank you very much for replying. Your suggestion helped, it now works as I want it

Best regards
Simone
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

table position in the text or end of document

Post by Stefan Kottwitz »

Hi Simone,

by the way, inside table and figure environments consider to use \centering instead of \begin{center}...\end{center}, that could cause additional vertical space, perhaps have a look at center vs. \centering.

Stefan
LaTeX.org admin
Post Reply