Graphics, Figures & Tablescolortbl and tabular* - messed up cells

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
mssm
Posts: 4
Joined: Thu Aug 19, 2010 7:46 pm

colortbl and tabular* - messed up cells

Post by mssm »

Using the code below, the tabular environment I create unfortunately looks not how I expected.
ugly.png
ugly.png (2.39 KiB) Viewed 1158 times
Can someone maybe help me figure out how to fix that? In particular, having the entire cell colored in the last row.

Code: Select all

\documentclass[a4paper,11pt]{article}
\usepackage{colortbl}
\begin{document}
\begin{tabular*}{\textwidth}[H]{@{\extracolsep{\fill}}|l|c|c|}
\hline
& \multicolumn{2}{c|}{} \\
& & \\ \hline
\multicolumn{3}{|l|}{} \\ \hline
& \cellcolor[gray]{0.85}  &\cellcolor[gray]{0.85} \\ \hline
\end{tabular*}
\end{document}

EDIT: I solved my problem by switching to the tabularx environment, which provides a more sane way of stretching tables - namely, by stretching the columns and not increasing the intercellular space (as done by tabular*).

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply