\BLOCK{- set first_style = {
    'left': 'l',
    'right': 'r',
    'center': 'c'
} -}
\BLOCK{- set rest_style = {
    'left': 'X',
    'right': 'Z',
    'center': 'Y',
    'justify': 'X'
} -}
\BLOCK{- if caption -}
\begin{table}[H]
\centering
\BLOCK{if label -}
\label{\VAR{label}}
\BLOCK{- endif}
\caption{\VAR{caption}}
\BLOCK{else}
\begin{center}
\BLOCK{- endif}
\BLOCK{- if is_large -}
\BLOCK{- endif}
\begin{tabularx}{\textwidth}{\BLOCK{- for column in columns}\BLOCK{- if loop.first }\VAR{first_style.get(column, 'l')}\BLOCK{- else }\VAR{rest_style.get(column, 'X')}\BLOCK{- endif }\BLOCK{- endfor}}
\toprule
\BLOCK{for row in rows -}
\BLOCK{- if loop.first -}
\BLOCK{- for col in row -}
   \textbf{\VAR{col}}\BLOCK{- if not loop.last} & \BLOCK{else} \\
\BLOCK{endif}
\BLOCK{- endfor}
\midrule
\BLOCK{else -}
\BLOCK{- for col in row -}
   \VAR{col}\BLOCK{- if not loop.last} & \BLOCK{else} \\
\BLOCK{endif}
\BLOCK{- endfor -}
\BLOCK{- endif -}
\BLOCK{- endfor}
\bottomrule
\end{tabularx}
\BLOCK{- if is_large -}
\BLOCK{- endif}
\BLOCK{- if caption -}
\end{table}
\BLOCK{- else}
\end{center}
\BLOCK{- endif}
