Graphics, Figures & TablesAlign Table Text vertically with horizontal Line

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
hexor47
Posts: 1
Joined: Fri Nov 11, 2011 10:46 pm

Align Table Text vertically with horizontal Line

Post by hexor47 »

Hello,

I have a tabular in which only vertical lines are visible.
It basically looks like this:

Code: Select all

\begin{tabular}{l}
    Some text \\
    \hline
\end{tabular}
What I would like to do is align vertically the text with the hline below. What I could do is deleting the extra space between the invisible vertical line of the tabular and the text, using "@{}" like so:

Code: Select all

\begin{tabular}{@{}l}
    Some text \\
    \hline
\end{tabular}
Unfortunately, this does not exactly do what I want. I would like the first letter of the text (here 'S') to be perfectly aligned with the beginning of the hline.

Does someone have a solution for this?

Recommended reading 2024:

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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Align Table Text vertically with horizontal Line

Post by Stefan Kottwitz »

Hi,

@{} works fine:

Code: Select all

\documentclass{article}   
\begin{document}
\begin{tabular}{@{}l@{}}
    Some text \\
    \hline
\end{tabular}
\end{document}
table.png
table.png (2.64 KiB) Viewed 1625 times
Stefan
LaTeX.org admin
Post Reply