A simple library to create and animate tables in ManimGL.
You can install the library via pip:
pip install manim-tableHere is how you create a basic table.
from manimlib import Scene, Write
from manim_table import Table
class TableExample(Scene):
def construct(self):
data = [
["Name", "Age", "City"],
["Alice", "25", "New York"],
["Bob", "30", "Paris"],
]
# Create the table
table = Table(data)
# Animate it
self.play(Write(table))You can add or remove rows and columns with animations.
# Add a new row
new_row, anims = table.add_row(["Charlie", "35", "London"])
self.play(AnimationGroup(*anims, lag_ratio=0.05))
# Delete a row (index starts at 1 for data rows)
deleted_row, anims = table.delete_row(1)
self.play(AnimationGroup(*anims, lag_ratio=0.05))You can easily change colors and styles.
from manimlib import BLUE, RED
# Style the header
table.set_header_background_color(BLUE)
# Style specific cells (row, column)
# Row 0 is header, Row 1 is first data row
table.get_cell(1, 1).set_font_color(RED)