Repository: ManimCommunity/manim

Issue:
Manim Table highlighted cells do not appear
## Description of bug / unexpected behavior
<!-- Add a clear and concise description of the problem you encountered. -->
The highlighted cells appear when calling `self.add(table)` but do not when calling `self.play(table.create)`. Calling `self.play(Create(table))` does solve the problem but the lines appear abruptly AND calling `self.play(Create(table))` is not advised in the documentation.

## Expected behavior
<!-- Add a clear and concise description of what you expected to happen. -->
The highlighted cells should get highlighted.

## How to reproduce the issue
<!-- Provide a piece of code illustrating the undesired behavior. -->
```py
from manim import *

class GetHighlightedCellExample(Scene):
    def construct(self):
        table = Table(
            [["First", "Second"],
            ["Third","Fourth"]],
            row_labels=[Text("R1"), Text("R2")],
            col_labels=[Text("C1"), Text("C2")])
        highlight = table.get_highlighted_cell((2,2), color=GREEN)
        table.add_to_back(highlight)
        self.play(table.create())
        self.wait(3)
```

## Additional media files
<!-- Paste in the files manim produced on rendering the code above. -->

<details><summary>Images/GIFs</summary>

https://user-images.githubusercontent.com/56092290/154514513-fd4f2c82-ce40-4ff2-9349-e57f72a138e2.mp4

</details>


## System specifications

<details><summary>System Details</summary>

- Windows 11
- RAM: 16
- Python version (`python/py/python3 --version`): 3.10.2
- Installed modules (provide output from `pip list`):
```
anyio                3.5.0
argon2-cffi          21.3.0
argon2-cffi-bindings 21.2.0
asttokens            2.0.5
atomicwrites         1.4.0
attrs                21.4.0
Babel                2.9.1
backcall             0.2.0
black                21.12b0
bleach               4.1.0
certifi              2021.10.8
cffi                 1.15.0
charset-normalizer   2.0.10
click                8.0.3
click-default-group  1.2.2
cloudpickle          2.0.0
cloup                0.7.1
colorama             0.4.4
colour               0.1.5
commonmark           0.9.1
cycler               0.11.0
debugpy              1.5.1
decorator            5.1.1
defusedxml           0.7.1
dill                 0.3.4
entrypoints          0.3
et-xmlfile           1.1.0
executing            0.8.2
Flask                2.0.2
fonttools            4.28.5
glcontext            2.3.4
gym                  0.21.0
idna                 3.3
iniconfig            1.1.1
ipykernel            6.7.0
ipython              8.0.0
ipython-genutils     0.2.0
isosurfaces          0.1.0
itsdangerous         2.0.1
jdc                  0.0.9
jedi                 0.18.1
Jinja2               3.0.3
json5                0.9.6
jsonschema           4.4.0
jupyter-client       7.1.1
jupyter-core         4.9.1
jupyter-server       1.13.3
jupyterlab           3.2.8
jupyterlab-pygments  0.1.2
jupyterlab-server    2.10.3
kiwisolver           1.3.2
manim                0.14.0
ManimPango           0.4.0.post0
mapbox-earcut        0.12.11
MarkupSafe           2.0.1
matplotlib           3.5.1
matplotlib-inline    0.1.3
mistune              0.8.4
moderngl             5.6.4
moderngl-window      2.4.1
multipledispatch     0.6.0
multiprocess         0.70.12.2
mypy-extensions      0.4.3
nbclassic            0.3.5
nbclient             0.5.10
nbconvert            6.4.0
nbformat             5.1.3
nest-asyncio         1.5.4
networkx             2.6.3
notebook             6.4.7
numpy                1.22.0
opencv-python        4.5.5.62
openpyxl             3.0.9
packaging            21.3
pandas               1.3.5
pandocfilters        1.5.0
parso                0.8.3
pathos               0.2.8
pathspec             0.9.0
pickleshare          0.7.5
Pillow               9.0.0
pip                  22.0.3
platformdirs         2.4.1
pluggy               1.0.0
pox                  0.3.0
ppft                 1.6.6.4
prometheus-client    0.12.0
prompt-toolkit       3.0.24
psutil               5.9.0
pure-eval            0.2.1
py                   1.11.0
pycairo              1.20.1
pycparser            2.21
pydub                0.25.1
pyglet               1.5.21
Pygments             2.11.2
pymssql              2.2.3
pyodbc               4.0.32
pyparsing            3.0.6
pyrr                 0.10.3
pyrsistent           0.18.1
pytest               6.2.5
python-dateutil      2.8.2
pytz                 2021.3
pywin32              303
pywinpty             1.1.6
pyzmq                22.3.0
requests             2.27.1
rich                 11.0.0
SALib                1.4.5
scipy                1.7.3
screeninfo           0.6.7
Send2Trash           1.8.0
setuptools           58.1.0
six                  1.16.0
skia-pathops         0.7.2
sniffio              1.2.0
sounddevice          0.4.4
srt                  3.5.0
stack-data           0.1.4
terminado            0.12.1
testpath             0.5.0
toml                 0.10.2
tomli                1.2.3
tornado              6.1
tqdm                 4.62.3
traitlets            5.1.1
typing_extensions    4.0.1
urllib3              1.26.8
watchdog             2.1.6
wcwidth              0.2.5
webencodings         0.5.1
websocket-client     1.2.3
Werkzeug             2.0.2
wget                 3.2
wheel                0.37.1
xlwings              0.25.3
```
</details>

<details><summary>FFMPEG</summary>

Output of `ffmpeg -version`:

```
ffmpeg version 5.0-essentials_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (Rev5, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
libavutil      57. 17.100 / 57. 17.100
libavcodec     59. 18.100 / 59. 18.100
libavformat    59. 16.100 / 59. 16.100
libavdevice    59.  4.100 / 59.  4.100
libavfilter     8. 24.100 /  8. 24.100
libswscale      6.  4.100 /  6.  4.100
libswresample   4.  3.100 /  4.  3.100
libpostproc    56.  3.100 / 56.  3.100
```
</details>

## Additional comments
<!-- Add further context that you think might be relevant for this issue here. -->



Discussion:

Resolving patch:
diff --git a/manim/mobject/table.py b/manim/mobject/table.py
--- a/manim/mobject/table.py
+++ b/manim/mobject/table.py
@@ -70,8 +70,10 @@ def construct(self):
 from colour import Color
 
 from .. import config
+from ..animation.animation import Animation
 from ..animation.composition import AnimationGroup
-from ..animation.creation import *
+from ..animation.creation import Create, Write
+from ..animation.fading import FadeIn
 from ..constants import *
 from ..mobject.geometry import Line, Polygon
 from ..mobject.numbers import DecimalNumber, Integer
@@ -894,11 +896,11 @@ def construct(self):
 
     def create(
         self,
-        run_time: float = 1,
         lag_ratio: float = 1,
-        line_animation: Callable[[VGroup], None] = Create,
-        label_animation: Callable[[VGroup], None] = Write,
-        element_animation: Callable[[VGroup], None] = Create,
+        line_animation: Callable[[VMobject | VGroup], Animation] = Create,
+        label_animation: Callable[[VMobject | VGroup], Animation] = Write,
+        element_animation: Callable[[VMobject | VGroup], Animation] = Create,
+        entry_animation=FadeIn,
         **kwargs,
     ) -> AnimationGroup:
         """Customized create-type function for tables.
@@ -939,27 +941,31 @@ def construct(self):
                     self.play(table.create())
                     self.wait()
         """
-        if len(self.get_labels()) > 0:
-            animations = [
-                line_animation(
-                    VGroup(self.vertical_lines, self.horizontal_lines),
-                    run_time=run_time,
-                    **kwargs,
-                ),
-                label_animation(self.get_labels(), run_time=run_time, **kwargs),
-                element_animation(
-                    self.elements_without_labels, run_time=run_time, **kwargs
-                ),
-            ]
-        else:
-            animations = [
-                line_animation(
-                    VGroup(self.vertical_lines, self.horizontal_lines),
-                    run_time=run_time,
-                    **kwargs,
-                ),
-                element_animation(self.elements, run_time=run_time, **kwargs),
+        animations: Sequence[Animation] = [
+            line_animation(
+                VGroup(self.vertical_lines, self.horizontal_lines),
+                **kwargs,
+            ),
+            element_animation(self.elements_without_labels.set_z_index(2), **kwargs),
+        ]
+
+        if self.get_labels():
+            animations += [
+                label_animation(self.get_labels(), **kwargs),
             ]
+
+        if self.get_entries():
+            for entry in self.elements_without_labels:
+                try:
+                    animations += [
+                        entry_animation(
+                            entry.background_rectangle,
+                            **kwargs,
+                        )
+                    ]
+                except AttributeError:
+                    continue
+
         return AnimationGroup(*animations, lag_ratio=lag_ratio)
 
     def scale(self, scale_factor: float, **kwargs):


Test patch: