2

Is it possible to directly modify the fonts in a table ?

For example I have :

\begin{tabular}{ |l|l| }
  \hline
  \multicolumn{2}{|c|}{Table of Bla } \\
  \hline
  test & test2 \\
  yes  & no    \\
  \hline
\end{tabular}

I would like to have the title Table of Bla in bold, is that possible ?

3
  • \multicolumn{2}{|c|}{\bfseries Table of Bla}
    – egreg
    Apr 11, 2013 at 21:35
  • @egreg Can you please reply as answer to mark it as correct ? Would the same work for content inside each cell ?
    – Razor
    Apr 11, 2013 at 21:44
  • For the content of the cell (and even the title of the table) you should use \textbf{bold stuff here} instead. Apr 11, 2013 at 21:45

1 Answer 1

2

All cells in a tabular environment form a group, so setting font attributes in one of them will not influence the other cells.

So the answer is

\begin{tabular}{ |l|l| }
\hline
\multicolumn{2}{|c|}{\bfseries Table of Bla} \\
\hline
test         & test2 \\
\itshape yes & no \\
\hline
\end{tabular}

I've set the first cell in the third row in italics, just to show another example.

One can also use

\textbf{Table of Bla}

and

\textit{yes}

but this just makes TeX work harder. Of course you should use the \textXX form for part of a cell contents, for instance

\multicolumn{2}{|c|}{\textbf{Table} of Bla} \
2
  • Thank you for the response. This might be related due to formatting cells in a table, how can you assign a shade (or color) to a specific row ? Or shall I create a new question for this ?
    – Razor
    Apr 11, 2013 at 21:54
  • @NLed Look at the colortbl package.
    – egreg
    Apr 11, 2013 at 21:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .