# Note inside cell with ctable

I would like to have the following table with notes at the end Which I can have with the ctable package

\documentclass[]{article}
\usepackage{ctable}
\begin{document}
\ctable[nosuper
]{p{1cm}p{6cm}p{1cm}p{2cm}p{2cm}}{
\tnote[a)]{My notes can be very long so then won't fit nicely
inside the table}
\tnote[b)]{note 2}
}{\FL
Item & Designation & Qty & Price & Comment  \ML
IT10 & Item1 & 2 &         xxx  & a) \NN
IT20 & Item2 & 1 &         xxx  & b) \ML
& Total price &  &  xxx  & \LL
}
\end{document}


But is there a way to have the note inline in the cell with an automatic increment of the counter? I am using a macro in excel to create this table and it would be easier to have the comment in a cell I can wrap instead of writing code to insert in the table parameters,

something like :

IT10 & Item1 & 2 &         xxx  & \tnote{this is my note} \NN


Please compare your original table and suggested solution. Some adjustments are needed, but I think it is what you are expecting.

\documentclass[]{article}
\usepackage{ctable}
\begin{document}
\ctable[nosuper
]{p{1cm}p{6cm}p{1cm}p{2cm}p{2cm}}{
\tnote[a)]{My notes can be very long so then won't fit nicely
inside the table}
\tnote[b)]{note 2}
}{\FL
Item & Designation & Qty & Price & Comment  \ML
IT10 & Item1 & 2 &         xxx  & a) \NN
IT20 & Item2 & 1 &         xxx  & b) \ML
& Total price &  &  xxx  & \LL
}

\newcounter{ttnote}
\setcounter{ttnote}{0}
\def\ttnote#1{\stepcounter{ttnote} \alph{ttnote}) {#1}}

\ctable[nosuper
]{p{1cm}p{6cm}p{1cm}p{2cm}p{2cm}}{
%\tnote[a)]{My notes can be very long so then won't fit nicely    inside the table}
%\tnote[b)]{note 2}
}{\FL
Item & Designation & Qty & Price & Comment  \ML
IT10 & Item1 & 2 &         xxx  & \ttnote{My notes can be very long so then won't fit nicely
inside the table} \NN
IT20 & Item2 & 1 &         xxx  & \ttnote{note 2} \ML
& Total price &  &  xxx  & \LL
}
\end{document}


• Thanks, this is interesting but not quite exactly what I want. In fact the code should be exactly what you typed but the result should be with the notes at the bottom of the table. In your solution the notes are in the comment cell. May 15, 2013 at 12:03