table_data.py 796 B

1234567891011121314151617181920212223242526
  1. import pandas as pd
  2. from example_library import ExampleLibrary
  3. from taipy.gui import Gui
  4. chessboard = [
  5. ["♖", "♘", "♗", "♕", "♔", "♗", "♘", "♖"],
  6. ["♙", "♙", "♙", "♙", "♙", "♙", "♙", "♙"],
  7. ["", "", "", "", "", "", "", ""],
  8. ["", "", "", "", "", "", "", ""],
  9. ["", "", "", "", "", "", "", ""],
  10. ["", "", "", "", "", "", "", ""],
  11. ["♟", "♟", "♟", "♟", "♟", "♟", "♟", "♟"],
  12. ["♜", "♞", "♝", "♛", "♚", "♝", "♞", "♜"]
  13. ]
  14. # Create a DataFrame to represent the chessboard
  15. data = pd.DataFrame(chessboard, columns=["A", "B", "C", "D", "E", "F", "G", "H"])
  16. page = """
  17. ## Chess Game
  18. <|{data}|example.basic_table|>
  19. """
  20. if __name__ == "__main__":
  21. Gui(page, libraries=[ExampleLibrary()]).run(title="Chess Game")