# How to align baseline of ordinary text with the baseline in tabular?

This code:

\documentclass[12pt]{article}
\begin{document}

\noindent
\begin{minipage}[t]{0.5\textwidth}
\hrule
TEXT TEXT TEXT TEXT TEXT
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
\hrule
\begin{tabular}[t]{rc}
TEXT & TEXT \\
TEXT & TEXT \\
\end{tabular}
\end{minipage}

\end{document}


produces two side-by-side minipages that start with a horizontal line. The left minipage contains ordinary text. The right minipage contains a table. The horizontal lines are at the same height. The baselines of the text are not:

I want that the baseline of the ordinary text (on the left) is the same as the baseline of the text in the first cell of the table (on the right). This would require either moving the text down, or moving the text in the table up.

What I tried:

• \renewcommand\arraystretch{0} eliminates the top padding, but it also eliminates the bottom padding and changes the height of the cells
• Setting \arraystretch to 0 and then replacing table rows by

TEXT & TEXT \\[0.5ex]


seems to eliminate the top padding and to do roughly what I want, but I would prefer to not contaminate every line of the table with non-DRY magic numbers.

What would be the proper way to align the baselines in the text (left) and the table (right)?

• Do you really want the rule touches the text on the left side? Mar 5 '19 at 19:50
• @Bernard The horizontal lines are merely supposed to show that the minipages are aligned properly. I the end of the day, I don't want to have any horizontal lines at all. All I want is to make the baselines of text on the left be the same as the baseline of the text on the right. The extra whitespace prevents this from happening. My assumption is that the whitespace marked with red arrows is some kind of table cell padding. I want to set it to zero, somehow. Mar 5 '19 at 19:57
• The simplest solution would be to slightly lower the text on the left side: just add a \strut before the text. Mar 5 '19 at 20:16
• the following mwe works perfectly: \documentclass[12pt]{article} \begin{document} \begin{minipage}[t]{0.22\linewidth} TEXT TEXT \end{minipage}\begin{minipage}[t]{0.22\linewidth} \begin{tabular}[t]{cc} TEXT & TEXT \\ TEXT & TEXT \\ \end{tabular} \end{minipage} \end{document}. it seems that unknown option H in tabular environment cause (together with hrule) troubles ... Mar 5 '19 at 20:44
• BTW, tabular is not a float, so no H option. The t/b/c option controls where the baseline is placed: top line, bottom line or center. Default is center. Mar 6 '19 at 16:33

Here is an explicitation of my comment: adding a strut in the first line of the left-hand side tex lowers this line exactly at the same level as the first row of the tabular:

\documentclass[12pt]{article}
\begin{document}

\noindent
\begin{minipage}[t]{0.5\textwidth}
\hrule
\strut TEXT TEXT TEXT TEXT TEXT

\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
\hrule
\begin{tabular}[H]{rc}
TEXT & TEXT \\
TEXT & TEXT \\
\end{tabular}
\end{minipage}

\end{document}