1
\documentclass{article}
\usepackage{forloop}
%\usepackage{a4paper,left=0cm,top=0cm}{geometry}
\newcommand{\aline}{\\\hline &&&&\rule{0cm}{.5cm}}
\begin{document}
\newcounter{theyflines}
\begin{tabular}{|p{3cm}|p{1cm}|p{.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{1cm}|p{1cm}|p{1cm}|p{1cm}}
\hline
Name& Room& L/11& D/11& B/12& L/12& D/12& B/13& L/13& D/13& B/14& L/1& Deposit& Cost& Extra& Due
\forloop{theyflines}{1}{\value{theyflines} < 15}{\aline}\\
\hline
\end{tabular}
\end{document}  

I modified this code from How to create attendance sheets? For this code the output looks like -

enter image description here

Expected output looks like -

enter image description here The column afterB/12 has no vertical bar. Why?

6
  • 1
    The problem is in your \aline macro. You only have 4 & symbols (giving 5 columns). You need 15 of them.
    – Sandy G
    Commented Jan 10, 2018 at 6:07
  • @SandyG yes, you are right. But, why the vertical bar is ovelapped the title?
    – alhelal
    Commented Jan 10, 2018 at 9:27
  • Your columns are too narrow. Simply change p{0.5cm} to p{0.7cm}
    – bmv
    Commented Jan 10, 2018 at 13:05
  • Or make the font smaller (e.g., scriptsize) in the title entries.
    – Sandy G
    Commented Jan 10, 2018 at 13:55
  • @bmv But, see there is space before the title.
    – alhelal
    Commented Jan 10, 2018 at 16:02

1 Answer 1

1
\documentclass{article}
\usepackage{forloop}
\usepackage[a4paper,left=0cm,top=0cm]{geometry}
\newcommand{\aline}{\\\hline &&&&&&&&&&&&&&\rule{0cm}{.4cm}}
\begin{document}
\newcounter{theyflines}
\begin{tabular}{|p{2.75cm}|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{1cm}|p{1cm}|p{1cm}|}
\hline
Name& Room&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

enter image description here

You must log in to answer this question.

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