1

From topic: I want to create a new command for making a table, parameters in the command would fill up the table

How can i draw border/frame around table?

Minimal code:

    \documentclass{article}
\usepackage{booktabs}
\usepackage{xparse}

\ExplSyntaxOn
\NewDocumentCommand{\cards}{ m }
 {
  \arne_card_distribution:n { #1 }
 }

\cs_new_protected:Nn \arne_card_distribution:n
 {
  \begin{tabular}{ *{5}{c} }
  \toprule
  A & B & C & D  \\
  \cmidrule{2-5}
  \clist_item:nn { #1 } { 1 }
    & \clist_item:nn { #1 } { 2 }
    & \clist_item:nn { #1 } { 3 }
    & \clist_item:nn { #1 } { 4 } \\
  \clist_item:nn { #1 } { 5 }
    & \clist_item:nn { #1 } { 6 }
    & \clist_item:nn { #1 } { 7 }
    & \clist_item:nn { #1 } { 8 } \\
  \clist_item:nn { #1 } { 9 }
    & \clist_item:nn { #1 } { 10 }
    & \clist_item:nn { #1 } { 11 }
    & \clist_item:nn { #1 } { 12 } \\
  \clist_item:nn { #1 } { 13 }
    & \clist_item:nn { #1 } { 14 }
    & \clist_item:nn { #1 } { 15 }
    & \clist_item:nn { #1 } { 16 } \\
  \bottomrule
  \end{tabular}
 }
\ExplSyntaxOff

\begin{document}

\cards{x,y,z,w/m,1,2,3,4,5,6,7,8,9,10,11,}

\end{document}

enter image description here Thanks in advance

3
  • 1
    This was possible by using tkz, refer the question tex.stackexchange.com/questions/10224/…, I am not sure about ExplSyntaxOn
    – MadyYuvi
    Sep 23, 2019 at 6:01
  • @MadyYuvi thanks. i tried but not work with Explsyntaxon. Thanks
    – latexforti
    Sep 23, 2019 at 7:43
  • 1
    You can use TikZ but you have to make sure to replace all spaces in option names with ~.
    – TeXnician
    Sep 23, 2019 at 8:22

0

You must log in to answer this question.

Browse other questions tagged .