\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}

\usepackage[margin=2cm]{geometry}
\usepackage{tabularx}

\begin{document}
\begin{center}
\huge{Liste des inscrits \og {{ wei.name }} \fg{}}

{% if bus %}
\LARGE{Bus {{ bus.name }}}


{% if team %}
\Large{Équipe {{ team.name }}}
{% endif %}
{% endif %}
\end{center}

\begin{center}
\begin{tabularx}{\textwidth}{|c|c|c|c|c|c|c|X|}
\hline
\textbf{Nom} & \textbf{Prénom} & \textbf{Genre} & \textbf{Département} & \textbf{Année} & \textbf{Bus} & \textbf{Équipe} & \textbf{Rôles} \\
\hline
{% for membership in memberships %}
{{ membership.user.last_name|safe }} & {{ membership.user.first_name|safe }} & {{ membership.registration.get_gender_display|safe }}
& {{ membership.user.profile.get_department_display|safe }} & {{ membership.user.profile.ens_year|safe }}A & {{ membership.bus.name|safe }}
& {% if membership.team %}{{ membership.team.name|safe }}{% else %}--{% endif %} & {{ membership.roles.all|join:", "|safe }} \\
\hline
{% endfor %}
\end{tabularx}
\end{center}
\end{document}
