TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create a table and to make all cells of a column emphasized. Is there a simple way to do it, or do I have to emphasize every single cell?

share|improve this question
4  
For rows please look at Make first row of table all bold; for columns a related post is Can I set the format of an entire column except for the header?. – Hendrik Vogt Mar 2 '11 at 14:31
up vote 18 down vote accepted

>{..} defines what to do before the cell

\documentclass{article}
\usepackage{array}

\begin{document}

\begin{tabular}{c >{\em}c c}
foo & bar & baz
\end{tabular}

\end{document}
share|improve this answer
    
The answers was perfect!! I really was looking for this to make the first row bold. THANKS!!!! Alex – user15254 Jun 4 '12 at 1:55
    
For this to work you need to \usepackage{array}. Otherwise you might get an "Error: Illegal character in array arg." – benroth Jul 19 at 14:48
    
the reason why I used this package ... ;-) – Herbert Jul 19 at 17:53

Just worth adding to @Herbert's answer, that you can also make an entire column bold with >{\bfseries}, used in exactly the same way as he uses >{\em}. The meaning of bfseries is discussed in detail here.

As stated in the comments here, you can use \normalfont{} to unbold the column header.

\begin{table}
    \begin{tabular}{>{\bfseries}l l}
        \toprule
        \normalfont{foo} & bar \\
        \midrule
        foo & baz \\
        bar & qux \\
        \bottomrule
    \end{tabular}
\end{table}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.