Graphics, Figures & TablesProblem with a Table using 'tabularx'

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
NELLLY
Posts: 113
Joined: Thu Nov 26, 2009 2:21 am

Problem with a Table using 'tabularx'

Post by NELLLY »

Hi
I faced a problem in writting a table

Code: Select all

\documentclass{report}
\usepackage{tabularx}
\begin{table}
\caption{....}
\begin{tabularx}{cXXXXXXXXXXXXXXX}{\textwidth}\hline
~~&\textit{Run}&\multicolumn {5}{c}{\bf\small{Basic
model}}&\multicolumn{5}{c}{\bf\small{ Bayesian
model}}&\multicolumn{4}{c}{\bf\small{I Bayesian model}}
\\\cline{3-7}\cline{8-12}\cline{13-16}\hline\\
~~&~~&$n^*_{B}$&$ih^*_{B}$&$h^*_B$&$TC^*_B$&$\Delta
C_B$&$ih^*_{VSS}$&$h^*_{VSS}$&$TC^*_{VSS}$&$\Delta
C_{VSS-s}$&$\Delta C_{VSS}-B$&$n^*_{VSI}$&$TC^*_{VSI}$&$\Delta
C_{VSI-s}$&$\Delta C_{VSI-B}$\\
\end{tabularx}
\end{table}
When I typset the foolowing error is recorded: "Missing number treated as zero".

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Problem with a Table using 'tabularx'

Post by Stefan Kottwitz »

Hi,

the width is the first argument to the tabularx environment. So, write

Code: Select all

\begin{tabularx}{\textwidth}{cXXXXXXXXXXXXXXX}\hline
Stefan
LaTeX.org admin
NELLLY
Posts: 113
Joined: Thu Nov 26, 2009 2:21 am

Re: Problem with a Table using 'tabularx'

Post by NELLLY »

Thanks Stefan I made the correction. However, a new typset error appears "extra alignment tab has been changed to \cr". I didn't know from where it comes.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Re: Problem with a Table using 'tabularx'

Post by Stefan Kottwitz »

There's probably one & too much. Count & and columns and compare to the tabular definition.

Stefan
LaTeX.org admin
Post Reply