[Tex/LaTex] Table formatting error extra alignment tab

errorstables

\begin{table}{ht}
\begin{tabular}{|cc|}
\hline
10g & Tryptone //
5g  & Yeast extract //
5g  & NaCl //
10g & Agar //
1ml & Ampicllin (100ng/ml)  /hline
\end{tabular}
\caption{Reagents for Lysogeny broth agar}
\label{table:LBAreagents}

\end{table}

I keep getting an error message and I can not for the life of me spot the problem, the error is said to be occurring on the yeast and agar code lines with the following code

Extra alignment tab has been changed to \cr.
<recently read> \endtemplate
l.164 5g &
Yeast //
You have given more \span or & marks than there were
in the preamble to the \halign or \valign now in progress.
So I'll assume that you meant to type \cr instead.
! Extra alignment tab has been changed to \cr.
<recently read> \endtemplate
l.166 10g &
Agar //
You have given more \span or & marks than there were
in the preamble to the \halign or \valign now in progress.
So I'll assume that you meant to type \cr instead.
[10]"

Any help would be very much appreciated.

n.b.
Preamble

\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{mathptmx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{color}
\usepackage{multirow}
\usepackage{soul}
\usepackage{caption}
\usepackage{natbib}
\usepackage{setspace}
\usepackage{placeins}
\usepackage[nottoc,numbib]{tocbibind}
\renewcommand{\bibname}{References}
\doublespacing
\usepackage[parfill]{parskip}

Best Answer

Like this?

I changed the {ht} to [ht] and then replaced the // with \\ and added an extra \\ before the last \hline

\begin{table}[ht]
\begin{tabular}{|cc|}
\hline
10g & Tryptone \\
5g  & Yeast extract \\
5g  & NaCl \\
10g & Agar \\
1ml & Ampicllin (100ng/ml) \\
\hline
\end{tabular}
\caption{Reagents for Lysogeny broth agar}
\label{table:LBAreagents}

\end{table}

enter image description here

I also took the liberty to update the table and introduce you to both the siunitx package for showing numbers with SI units and the mhchem package for chemical formulas and the booktabs package for nicer formatting of the table. But that is of course my preference :)

\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage{mathptmx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{color}
\usepackage{multirow}
\usepackage{soul}
\usepackage{caption}
\usepackage{natbib}
\usepackage{setspace}
\usepackage{placeins}
\usepackage[nottoc,numbib]{tocbibind}
\renewcommand{\bibname}{References}
\doublespacing
\usepackage[parfill]{parskip}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage[version=3]{mhchem}
\begin{document}
\begin{table}[ht]
\centering
\caption{Reagents for Lysogeny broth agar}
\label{table:LBAreagents}
\begin{tabular}{cc}
\toprule
Quantities & Ingredient \\
\midrule
\SI{10}{\gram} & Tryptone \\
\SI{5}{\gram}  & Yeast extract \\
\SI{5}{\gram}  & \ce{NaCl} \\
\SI{10}{\gram} & Agar \\
\SI{1}{\milli\litre} & Ampicllin (\SI{100}{\nano\gram\per\milli\litre)} \\
\bottomrule
\end{tabular}

\end{table}

\end{document}

would give something like this

enter image description here

Related Question