Hi everyone,
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
Graphics, Figures & Tables ⇒ problem centering a table
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
problem centering a table
I can't comprehend the problem. The code below works as expected.
I will spare more suggestions for improvements at this point.
Please use the »Code« environment when posting code.
Thorsten
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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10