This commit introduces a feature to add a sticky first column
to tables generated from the list-table directive in Sphinx.
The first column now remains fixed during horizontal
scrolling, enhancing the user experience and improving
readability, especially for long tables such as the one in
infra/inventory.rst.
The implementation uses CSS with `position: sticky`. The
CSS is added to _static/css/sticky-table-column.css and
included in the Sphinx build via conf.py.
Change-Id: Ie68a3524bc34c38149e85c86ed4ea0d8a5f09ffe
Signed-off-by: Vanessa Valderrama <vvalderrama@linuxfoundation.org>
--- /dev/null
+.rst-content .list-table table td:nth-child(1) {
+ position: sticky;
+ left: 0;
+ background-color: white;
+ z-index: 1;
+}
+
+.rst-content .list-table table th:nth-child(1) {
+ position: sticky;
+ left: 0;
+ background-color: white;
+ z-index: 2;
+}
def setup(app):
"""Injects the report issue ribbon."""
app.add_css_file("css/ribbon.css")
+ app.add_css_file("css/sticky-table-column.css")