Graphics, Figures & TablesCaption Text Changing Rows

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
timbuck1200
Posts: 1
Joined: Tue Sep 19, 2017 8:21 am

Caption Text Changing Rows

Post by timbuck1200 »

I am having a problem using captions with Tables. My caption seems to have a weird border so it creates a new line using only one or two words when trying to caption a table. I would like the caption to be on one line under the table.
Here is the code I am using and a picture of the problem. Any help is much appreciated on how to make my borders for the caption run the full length of the table.

\begin{table}[H]
\parbox{.2\linewidth}{
\centering
\label{dt1}
\begin{tabular}{ccc}
&Upward Balancing &Downward Balancing\\
\hline
Surplus imbalance &Elspot price & (BM-) \\
Deficit imbalance &(BM+) & Elspot price \\

\hline
\end{tabular}
\subcaptionbox{Imbalance Prices for Producers}
}
\end{table}

LATEX.jpg
LATEX.jpg (19.07 KiB) Viewed 1181 times

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

Stefan Kottwitz
Site Admin
Posts: 10328
Joined: Mon Mar 10, 2008 9:44 pm

Caption Text Changing Rows

Post by Stefan Kottwitz »

Hi Tim,

welcome to the forum!

This seems to math the parbox with 0.2 line length. Remove that \parbox and its closing brace to see the change.

0.2 of the line width doesn't fit to the table width anyway.

By the way, always use \label directly after a caption.

Stefan
LaTeX.org admin
Post Reply