Graphics, Figures & TablesTable not showing upper bars

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ljguillermo23
Posts: 1
Joined: Mon Apr 17, 2023 8:22 pm

Table not showing upper bars

Post by ljguillermo23 »

In some situations tables dont show upper bars because there is no space. I usually do tables like this cause im not comfortable doing them in any other way but im open to suggestions. How would you fix this isue?

Code: Select all

\begin{table}[h!]
\caption{Medidas para la obtención del diámetro del disco de Airy}
\centering
\begin{tabular}{c c c c}        % centered columns (4 columns)
\hline\hline
% inserts double horizontal lines
$x'_1 \pm \varepsilon(x'_1)(mm)$ & $x'_2 \pm \varepsilon(x'_2)(mm)$ & $ H\pm\varepsilon(H)(mm)$ & $ \bar H\pm\varepsilon(\bar H)(mm)$\\
\hline                        % inserts single horizontal line
   $0 \pm 0.01$ & $1.21\pm 0.01$ &$1.21\pm 0.01$ & $1.19\pm 0.02$\\      % inserting body of the table
   $0 \pm 0.01$ & $1.15\pm 0.01$ & $1.15\pm 0.01$\\
   $0 \pm 0.01$ & $1.20\pm 0.01$ & $1.20\pm 0.01$\\

\hline                                   %inserts single line
\end{tabular}
\end{table}
Last edited by Stefan Kottwitz on Fri Apr 21, 2023 10:07 am, edited 1 time in total.
Reason: \varepsilon corrected

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Table not showing upper bars

Post by kaiserkarl13 »

I'm not sure what you mean here; this works for me once I change \varepsilo to \varepsilon.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Table not showing upper bars

Post by Stefan Kottwitz »

Hi,

welcome to the forum!

I corrected the \varepsilon in your code snipped so it can be compiled without error. Click on "Run LaTeX now" here in the forum below your code, you will see that the lines are there.

Can you post a small (compilable) example code that has this issue?

Stefan
LaTeX.org admin
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Table not showing upper bars

Post by Stefan Kottwitz »

I think now I understand you mean the bars above characters, not the bars of the table.

There are possibilities such as \arraystretch and \extrarowheight, though they may have effect on all rows. Here's a quick hack: you could add an empty line and negative space to make it small, like this for the code line 5:

Code: Select all

\hline\hline\\[-2.2ex]
Stefan
LaTeX.org admin
Post Reply