1

This is the error I have gotten while having my table as here ;

 ! Extra alignment tab has been changed to \cr.

\endtemplate

l.168 Sample & Size ( $\mu$ m) & Main mineral phases \

\begin{table}
    \caption[]{Main composition of the studied regolith samples}
        \label{Tab1}
        $$
        \begin{array}{p{0.5\linewidth}}
            \hline
            \noalign{\smallskip}
            Sample & Size ( $\mu$ m) & Main mineral phases \\
            \noalign{\smallskip}
            \hline
            \noalign{\smallskip}
                RA-QD02-0014 & 131.2 $ \pm$ 0.1 & Olivine, low-Ca pyroxene, plagioclase \\
                RA-QD02-0023 & 149.4 $ \pm$ 0.1 & Olivine, troilite \\
                RA-QD02-0047 & 108.0 $ \pm$ 0.1 & Olivine, low-Ca and high-Ca pyroxene \\
            \noalign{\smallskip}
            \hline
        \end{array}
            $$
\end{table}
  • You've defined the array environment with a single column (of type p), yet you then proceed to populate it with 3 rows, each containing 3 columns. – Mico Feb 8 at 14:21
  • How should I define 3 columns? – Yasamin Feb 8 at 14:25
  • \begin{array}{p{0.25\linewidth}p{0.25\linewidth}p{0.25\linewidth} will define 3 columns, of course narrower than one huge one. – user31729 Feb 8 at 14:56
  • Where did you get the code from to begin with? It is quite strange. – Johannes_B Feb 9 at 12:24
6

The immediate problem is that you've defined the array environment to have a single column, yet the tabular material has three columms.

Using an array environment for the material at hand isn't all that convenient, as only one of the three columns contains anything math-y. It would be better to use a tabular environment. Also, using lots of \noalign{\smallskip} instances is cumbersome; it's preferable to load the booktabs package and employ its macros \toprule, \midrule, and \bottomrule to generate well-spaced horizontal lines. A separate comment: To typeset scientific units such as "micro-meters", consider loading the siunitx package and employing that package's \si macro.

Here's how I would display the table.

enter image description here

\documentclass{article}
\usepackage{array}  % for '\newcolumntype' macro
\newcolumntype{C}{>{$}c<{$}} % automatic math mode, centering
\usepackage[skip=0.333\baselineskip]{caption}
\usepackage{booktabs, % '\toprule', '\midrule', etc.
            amsmath,  % for '\text'  macro
            siunitx}  % for '\si' macro

\begin{document}
\begin{table}
    \caption{Main composition of the studied regolith samples}
    \label{Tab1}
    \centering
    \begin{tabular}{@{} lCl @{}} % middle column is in math mode automatically
    \toprule
    Sample & \text{Size (\si{\micro\meter})} & Main mineral phases \\
    \midrule
    RA-QD02-0014 & 131.2 \pm 0.1 & Olivine, low-Ca pyroxene, plagioclase \\
    RA-QD02-0023 & 149.4 \pm 0.1 & Olivine, troilite \\
    RA-QD02-0047 & 108.0 \pm 0.1 & Olivine, low-Ca and high-Ca pyroxene \\
    \bottomrule
    \end{tabular}
\end{table}
\end{document} 


*Addendum to address the OP's follow-up questions:

  • Keep captions short and snappy. If the table requires a legend, don't place the legend inside the argument of \caption.

  • If your table has 7 columns (1 header column and 6 data columns), you need to provide 7, not 6, column specifiers.

  • For improved legibility of the tabular material, consider placing the units of measurement in a separate row.

enter image description here

\documentclass{article}
\usepackage[a4paper,margin=2.5cm]{geometry} % choose suitable page parameters
\usepackage{array}  % for '\newcolumntype' macro
\newcolumntype{C}{>{$}c<{$}} 
\usepackage[skip=0.333\baselineskip]{caption}
\usepackage{booktabs, % '\toprule', '\midrule', etc.
            amsmath,  % for '\text'  macro
            siunitx}  % for '\si' macro
\sisetup{per-mode=symbol}
\begin{document}

\begin{table}
\caption{Average mechanical properties of Itokawa regolith silicates in particles of given S\#.} 
%% keep captions short and snappy!
\label{Tab2}

Reduced Young's modulus ($E_r$), hardness ($H$), constant stiffness ($S$), elastic recovery ($U_{\mathrm{el}}/ U_{\mathrm{tot}}$) and plasticity index ($U_{\mathrm{pl}}/ U_{\mathrm{tot}}$) were calculated by averaging the results from two lines of indentations from the maximum applied force of \SI{10}{\milli\newton}.

\medskip
\centering
\begin{tabular}{@{} l CCCCCC @{}}
\toprule 
Sample 
& \text{Applied Force} & E_{r} & H & S 
& U_{\mathrm{el}}/ U_{\mathrm{tot}} 
& U_{\mathrm{pl}}/ U_{\mathrm{tot}}\\ 
& (\si{\milli\newton}) 
& (\si{\giga\pascal})
& (\si{\giga\pascal}) 
& (\si{\milli\newton\per\micro\meter})\\ % micron = micro-meter ??
\midrule
RA-QD02-0014 
& \cdots & \cdots & \cdots 
& \cdots & \cdots & \cdots \\
\bottomrule
\end{tabular}
\end{table}
\end{document} 
  • Thank you. That works now. I try it for the next table, but I get some errors. – Yasamin Feb 9 at 11:25
  • Thos it work for six coloumns? – Yasamin Feb 9 at 11:27
  • \begin{tabular}{@{} l @{} l Cl @{} l @{} l C l C } % middle column is in math mode automatically \toprule Sample & Applied Force (mN) & E_{r} (GPa) & H (GPa) & S (mN/ micron) & U_{el}/ U_{tot} & U_{pl}/ U_{tot}\\ – Yasamin Feb 9 at 11:27
  • @Yasamin - Your example seems to have 7 columns, not 6. – Mico Feb 9 at 11:38
  • 1
    @Yasamin - "Is there anything wrong with my caption?" Yes! Several things, in fact. Please see the addendum I just posted. – Mico Feb 9 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.