Here (Automatic table row numbers) they shows automatic table row numbering. But, there they made the table manually and applied the technique.
When I make a attendance sheet I can make the sheet by looping. So, then how can I give the serial number in the table?
My sample code is -
\documentclass{article}
\usepackage{forloop}
\usepackage[a4paper,left=0cm,top=0cm]{geometry}
\newcommand{\aline}{\\\hline &&&&&&&&&&&&&&&&\rule{0cm}{.4cm}}
\begin{document}
\newcounter{theyflines}
\begin{tabular}{|p{0.20cm}|p{2.75cm}|p{1cm}|p{1cm}|p{.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{0.35cm}|p{2.60cm}|p{1.30cm}|p{1.30cm}|}
\hline
SL&Name& Room&Dept.&L&D&B&L&D&B&L&D&B&L&Deposit&Cost&Extra
\forloop{theyflines}{1}{\value{theyflines} < 48}{\aline}\\
\hline
\end{tabular}
\end{document}
output -
My expected output -


