from markupsafe import Markup class matchSquadTable: def __init__(self, items): self.items = items self.border = True self.classes = [] def __html__(self): """Generate HTML table from items""" if not self.items: return Markup('
No players in squad
') # Start table with Bootstrap 5 classes classes_str = ' '.join(self.classes) if self.classes else 'table table-striped table-hover' html = f'
\n' # Table header with modern styling html += ' \n \n' html += ' \n' html += ' \n' html += ' \n' html += ' \n' html += ' \n' html += ' \n \n' # Table body with enhanced styling html += ' \n' for item in self.items: html += ' \n' html += f' \n' html += f' \n' html += f' \n' html += f' \n' html += f' \n' html += ' \n' html += ' \n' # End table html += '
Player NumberNicknameSurnameForenamesActions
#{item.get("playernumber", "")}{item.get("playernickname", "")}{item.get("playersurname", "")}{item.get("playerforenames", "")}' html += f'
' html += f'
\n' return Markup(html)