1

I'm very new to Latex. So i want to put a \bar W in a table but the bar is covered by the horizontal line of table.So it becomes invisible. I tried adding \noalign{\smallskip} after \hline but it cuts the vertical line of the table. Any suggestion?

Here is the code:

\begin{center}
    \begin{tabular}{ | l |  l |}
    \hline
    $\bar W $ & $A$  \\ \hline  \noalign{\smallskip}  
    $\bar W $ & $A$  \\ \hline 
    ... & ... \\ \hline
    \end{tabular}
\end{center}

First bar is invisible and second one cuts the table.

Xavier
  • 13,947
Mike Shaw
  • 235
  • Can you give an example of your code? Have you had a look at the latex wiki here? –  May 03 '13 at 14:45
  • You can use vertical struts in your table rows to move content up/down. For example, a vertical strut \rule{0pt}{1em} is high enough to expose the \bar. It's a zero-width rule of height 1em. There are other ways as well, most of which are contained in Column padding in tables. – Werner May 03 '13 at 16:51
  • Welcome to TeX.sx! Your post was migrated here from [so]. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – egreg May 03 '13 at 19:41

1 Answers1

2

Package array provides the length \extrarowheight that is added to each table row:

\documentclass{article}
\usepackage{array}
\setlength{\extrarowheight}{.5ex}
\begin{document}
\begin{center}
    \begin{tabular}{ | l |  l |}
    \hline
    $\bar W $ & $A$  \\ \hline
    $\bar W $ & $A$  \\ \hline
    ... & ... \\ \hline
    \end{tabular}
\end{center}
\end{document}

Result

The effect can also be limited to the single table by setting \extrarowheight inside the center environment.

Heiko Oberdiek
  • 271,626