[Tex/LaTex] Package tabularx (Error: Missing number, treated as zero.)

tabularx

i have the following content and my compiler gives me this error messages:

! Missing number, treated as zero.
! Illegal unit of measure (pt inserted). 
! Package calc Error: `c' invalid at this point.
! Package array Error: Illegal pream-token (V): `c' used.
! Extra alignment tab has been changed to \cr.

Here is the code:

\usepackage{tabularx}           %for nicer tables


\begin{document}
...

\begin{table}[H]
\caption{Berechnete Konzentrationen der Proteinprobe.}
\label{tab:Protein}
\begin{tabularx}{cccccc}
Verd. & $\upsigma$\textsubscript{korr.} & $\upbeta$ / $\upmu$g/ml & +/- & $\Delta$ $\upbeta$ / $\upmu$g/ml & rel. Fehler / \%\tabularnewline
\hline 
1:20 & 0.0182 & 958.79 & +/- & 113.39 & 11.83\tabularnewline
1:50 & 0.0038 & 1151.56 & +/- & 153.83 & 13.36\tabularnewline
1:100 & 0.0113 & 1405.68 & +/- & 331.68 & 23.60\tabularnewline
1:250 & 0.0581 & 2323.72 & +/- & 2727.75 & 117.39\tabularnewline
\end{tabularx}
\end{table}

\end{document}

The whole thing works with "tabular" but i want the whole bandwidth.

Any ideas?

here are ALL the packages i used

\documentclass[a4paper,12pt]{article} %scrartcl
\usepackage{geometry}
\geometry{
  left=2.5cm,
  right=2.5cm,
  top=2.5cm,
  bottom=4cm}

\usepackage{tabularx}
%%CHEM%%
\usepackage[version=4]{mhchem} 
\usepackage{siunitx}
\usepackage{chemgreek}
\usepackage{upgreek}
\usepackage[greek=upgreek]{chemmacros}
 %griech alph
\usepackage{pdftexcmds}
\DeclareChemParticle\alphaparticle{\chemalpha}
%%MATH%%
\usepackage{amsmath}
\usepackage{amsthm}             %for theorems http://en.wikibooks.org/wiki/LaTeX/Theorems
\usepackage{braket}             %for Dirac bra-ket notation
\usepackage{bm}             %for bold math like vectors
\usepackage{nicefrac}           %for nice fractions
\usepackage{esdiff}         %for partial differtiation diffp
%%FONT%%
\usepackage{bbold}          %unity matrix symbol
\usepackage[ngerman]{babel}
%\usepackage{datetime}
%%FIGURES, DIAGRAMS, TABLES%%
\usepackage{tikz}               %DIA diagrams
\usepackage{color}          %for colors in text
\usepackage{graphicx}           %for including graphics
\usepackage{caption}
\usepackage{subcaption}         %more figures in one float
\usepackage{floatrow}
\usepackage{rotating}           %for rotated big figures
\usepackage{caption,booktabs}           %better tables
\usepackage{tabularx}           %for nicer tables
\usepackage[hang]{footmisc}
%%EXTRA FUNCTIONALITY%%
\usepackage[printonlyused]{acronym} %for acronyms
    %for hyperrefs, backref to show page number in references
%   \renewcommand*{\backref}[1]{}
%   \renewcommand*{\backrefalt}[4]{
%           \ifcase #1 (Not cited.)
%           \or        (Cited on page~#2.)
%           \else      (Cited on pages~#2.)
%       \fi}
%\usepackage[bottom]{footmisc}      %to have footnotes at bottom
%%BUG FIXES%%
    %otherwise warnings

%%DOCUMENT SETTINGS%%

\usepackage[utf8x]{inputenc}        %utf-8 encoding
\usepackage[onehalfspacing]{setspace}   %Zeilenabstand im Fließtext

\setlength{\parindent}{0pt}         %Zeileneinzug bei neuem Absatz
\setlength{\parskip}{7pt}       %Abstand zwischen Absätzen

\newcolumntype{b}{X}
\newcolumntype{s}{>{\hsize=.5\hsize}X}

\usepackage[square,numbers,sort&compress,comma]{natbib}
\renewcommand{\listfigurename}{List of Figures}

Best Answer

You are missing the information how wide the table should be:

\begin{tabularx}{\textwidth}{XXXXXX}

I used \textwidth to define the width - you also can use 80mm for example or 0.75\textwidth.

\documentclass{article}
\usepackage{tabularx}
\usepackage[showframe=true]{geometry}
\usepackage{float}

\begin{document}

\begin{table}[H]
\caption{Some Caption in German}
\label{tab:Protein}
\begin{tabularx}{\textwidth}{XXXXXX}
Verd. & $\sigma$\textsubscript{korr.} & $\beta$ / $\mu$g/ml & +/- & $\Delta$ $\beta$ / $\mu$g/ml & rel. Fehler / \%\tabularnewline
\hline 
1:20 & 0.0182 & 958.79 & +/- & 113.39 & 11.83\tabularnewline
1:50 & 0.0038 & 1151.56 & +/- & 153.83 & 13.36\tabularnewline
1:100 & 0.0113 & 1405.68 & +/- & 331.68 & 23.60\tabularnewline
1:250 & 0.0581 & 2323.72 & +/- & 2727.75 & 117.39\tabularnewline
\end{tabularx}
\end{table}

\end{document}

enter image description here

  • Your code is missing a document class.
  • Your code uses the [H] option but doesn't provide the float package (leads to an error).
  • Your code uses some \up... math commands that are not supported by the packages you use in your code (leads to an error).
  • I added the geometry package with the showframe=true option in order to show that the table uses the whole \textwidth.
Related Question