1

I want to enumerated each row in table, but with varying enumeration of items in each cell, appearing like this in an automatic way:

\begin{tabular}{|c|c|c|c|c|c|}
    \hline
    Col 0 & Col 1 & Col 2 & Col 3 & Col 4 & Col 5\\
    \hline 
    a) & ... & ... & ... & ... & ... \\ 
    \hline 
    b) & ... & ... & ... & ... & ... \\
    \hline 
    c) & ... & ... & ... & ... & ... \\ 
                   .
                   .
                   .
\end{tabular}

I tried to use the answer for this question replacing a) with \begin{enumerate}[series=table] \item \end{enumerate} and then resume but didn't work.

5
  • What and whare do you want to resume? The row numbering in another tabular?
    – Bernard
    Oct 19, 2019 at 23:35
  • Where is a) I would put \begin{enumerate}[series=table] \item \end{enumerate} and then where is b) it would be \begin{enumerate}[resume*=table] \item \end{enumerate} ans son on Oct 20, 2019 at 0:03
  • It can be done in a much more simple way defining a new counter which is automatically increased at each new row.
    – Bernard
    Oct 20, 2019 at 0:09
  • Something like this? . I don't know how to change the numbers for letters. I need them to be a), b) , c) .. instead of 1, 2, 3 ... Oct 20, 2019 at 0:13
  • Thanks @Bernard Oct 20, 2019 at 2:50

1 Answer 1

3

Here is a simple code:

    \documentclass{article}
     \usepackage{array}
     \setlength{\extrarowheight}{2pt}
    \newcounter{rowcount}

    \begin{document}

    \begin{tabular}{|>{\stepcounter{rowcount}\alph{rowcount})}c@{}*{5}{c|}}
    \cline{2-6}
       \multicolumn{1}{c}{} & \multicolumn{1}{|c}{Col 1 }& Col 2 & Col 3 & Col 4 & Col 5\\
       \noalign{\setco

unter{rowcount}{0}} \hline
    & blah & blah & blah & blah & blah \\
    \hline
    & ... & ... & ... & ... & ... \\
    \hline
      & ... & ... & ... & ... & ... \\
    \hline
    \end{tabular}
    \bigskip

    \begin{tabular}{|>{\stepcounter{rowcount}\alph{rowcount})}c@{}*{5}{c|}}
    \cline{2-6}
   \multicolumn{1}{c}{} & \multicolumn{1}{|c}{Col 1} & Col 2 & Col 3 & Col 4 & Col 5\\
   \noalign{\setcounter{rowcount}{0}} \hline
    & blah & blah & blah & blah & blah \\
    \hline
    & ... & ... & ... & ... & ... \\
    \hline
          & ... & ... & ... & ... & ... \\
    \hline
    \end{tabular}

    \end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .