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 1174 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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply