{% if 'style' not in options %}
	{% do options.__setitem__('style', '3-line') %}
{% endif %}
{% if 'titled' not in options %}
	{% do options.__setitem__('titled', True) %}
{% endif %}

\begin{center}
{
{% if 'font_size' in options %}
	\fontsize{ {{options['font_size']}} }{ {{options['font_size'] * 1.2}} }\selectfont
{% endif %}
	{%- if 'width' in options and options['width'] -%}
		{% set sum_width = tools.sum(options['width']) %}
		\begin{tabularx}{\the \textwidth}
	{%- else -%}
		\begin{tabular}
	{%- endif -%}
		{ {% if options['style'] == 'normal' -%}
			|
		{%- else -%}
			@{}
		{%- endif -%}
			{%- for i in range(width) -%}
				{%- if 'width' in options and options['width'] -%}
					>{ \hsize={{ tools.float(options['width'][i]) / sum_width }} \hsize \centering }X
				{%- else -%}
					c
				{%- endif -%}
				{%- if not loop.last -%}
					|
				{%- endif -%}
			{%- endfor -%}
		{%- if options['style'] == 'normal' -%}
			|
		{%- else -%}
			@{}
		{%- endif %} }
		{% if options['style'] == 'normal' %}
			\hline
		{% else %}
			\bhline
		{% endif %}
		{% for i in range(table.__len__()) %}
			{%- set ifirst = loop.first -%}
			{% for j in range(table[i].__len__()) -%}
				{%- if table[i][j] != None -%}
					{%- if ifirst -%}
						{{ table[i][j] }}
					{%- else -%}
						{%- if cnt[i][j] > 1 -%}
							\multirow{ {{- cnt[i][j] -}} }{*}{
								{%- if 'width' in options and options['width'] -%}
									\parbox{ \hsize }{ \centering {{table[i][j]}} }
								{%- else -%}
									{{table[i][j]}}
								{%- endif -%}
							}
						{%- else -%}
							{{table[i][j]}}
						{%- endif -%}
					{%- endif -%}
				{%- endif -%}
				{%- if loop.last -%}
					\tabularnewline
				{%- else -%}
					&
				{%- endif -%}
			{%- endfor -%}
			{%- if loop.first and options['titled'] and options['style'] == '3-line' -%}
				\mhline
			{%- elif loop.last and options['style'] == '3-line' -%}
				\bhline
			{%- else -%}
				{%- for j in range(table[i].__len__()) -%}
					{%- if i + 1 == table.__len__() or table[i + 1][j] != None -%}
						\cline{ {{- j + 1 -}} - {{- j + 1 -}} }
					{%- endif -%}
				{%- endfor -%}
			{%- endif %}
		{% endfor %}
	{%- if 'width' in options and options['width'] -%}
		\end{tabularx}
	{%- else -%}
		\end{tabular}
	{%- endif -%}
}
\end{center}
