Graphics, Figures & Tables ⇒ problem centering a table
problem centering a table
I have the following table (see example). The problem is that it is located in the middle of a page (vertical and horizontal centering), and I just want it to be located next to the main text and horizontally centered. I don't know what the problem with the code is. I have tried with begin{center}, but just move the tabular area.
\begin{table}[htbp]
\caption{Estimation results c8.2 (i)
\label{c8.2a}}
\centering
\begin{tabular}{lcc} \hline\hline
& (1) & (2) \\
VARIABLES & price & price \\ \hline
& & \\
lotsize & 0.00207*** & 0.00207 \\
& (0.000642) & (0.00125) \\
sqrft & 0.123*** & 0.123*** \\
& (0.0132) & (0.0177) \\
bdrms & 13.85 & 13.85 \\
& (9.010) & (8.479) \\
Constant & -21.77 & -21.77 \\
& (29.48) & (37.14) \\
& & \\
Observations & 88 & 88 \\
R-squared & 0.672 & 0.672 \\ \hline
\multicolumn{3}{c}{ Standard errors in parentheses} \\
\multicolumn{3}{c}{ *** p$<$0.01, ** p$<$0.05, * p$<$0.1} \\
\end{tabular}
\end{table}
Thank you in advance.
Sebastian
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
problem centering a table
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}
\usepackage{blindtext}
\begin{document}
\blindtext
\begin{table}[!ht]
\caption{Estimation results c8.2 (i)}\label{c8.2a}
\centering
\begin{tabular}{lcc} \hline\hline
& (1) & (2) \\
VARIABLES & price & price \\ \hline
& & \\
lotsize & 0.00207*** & 0.00207 \\
& (0.000642) & (0.00125) \\
sqrft & 0.123*** & 0.123*** \\
& (0.0132) & (0.0177) \\
bdrms & 13.85 & 13.85 \\
& (9.010) & (8.479) \\
Constant & -21.77 & -21.77 \\
& (29.48) & (37.14) \\
& & \\
Observations & 88 & 88 \\
R-squared & 0.672 & 0.672 \\ \hline
\multicolumn{3}{c}{ Standard errors in parentheses} \\
\multicolumn{3}{c}{ *** p$<$0.01, ** p$<$0.05, * p$<$0.1} \\
\end{tabular}
\end{table}
\end{document}
Please use the »Code« environment when posting code.
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10