Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sphinx-needs datatable is rendered into a header column #1287

Open
JochenKienzle opened this issue Feb 28, 2022 · 5 comments
Open

sphinx-needs datatable is rendered into a header column #1287

JochenKienzle opened this issue Feb 28, 2022 · 5 comments
Labels
Bug A bug Needed: replication Bug replication is required

Comments

@JochenKienzle
Copy link

JochenKienzle commented Feb 28, 2022

Problem

The table of a sphinx-needs datatable is rendered into one column of the header which leads to a high horizontal width. In other themes the header is rendered on top of the table.

Reproducible Project

The following rst file is used to render the error image.

==========
Test Specs
==========

Summary
-------

.. needtable::
   :types: test-spec
   :style: datatable
   :columns: id, title, status, tags

.. test-spec:: Test 1
   :id: TEST_SPEC_1
   :status: failed
   :tags: tag1

   Test 1

.. test-spec:: Test 2
   :id: TEST_SPEC_2
   :status: failed
   :tags: tag1

   Test 2

.. test-spec:: Test 3
   :id: TEST_SPEC_3
   :status: failed
   :tags: tag1

   Test 3

.. test-spec:: Test 4
   :id: TEST_SPEC_4
   :status: failed
   :tags: tag1

   Test 4

Error Logs/Results

The picture below shows that the table is rendered as column of the header.

image

Expected Results

Header columns of data table is rendered as a separate row and don't interfere with the table below. (Alabaster theme with the same code)

image

Environment Info

  • Python Version: 3.10
  • Sphinx Version: 4.3.1
  • RTD Theme Version: 1.0.0
@JochenKienzle JochenKienzle added Bug A bug Needed: replication Bug replication is required labels Feb 28, 2022
@JochenKienzle JochenKienzle changed the title sphinx-needs datatable header is rendered in columns sphinx-needs datatable is rendered in header columns Feb 28, 2022
@JochenKienzle JochenKienzle changed the title sphinx-needs datatable is rendered in header columns sphinx-needs datatable is rendered into a header column Feb 28, 2022
@danwos
Copy link

danwos commented Mar 2, 2022

There is already a PR to fix this problem a little bit #1218

Sphinx-Needs already has the needed, rtd specific code.
All we need is this PR, so that the rtd specific table handling can be deactivated for tables under the control of extensions.

@JochenKienzle
Copy link
Author

@danwos

Many thanks for your feedback.
Is there any short-term solution available like a patch or a theme-option?

I have tried to change the line
$("table.docutils:not(.field-list,.footnote,.citation,.rtd-exclude-wy-table)")
in my theme.js but it wasn't fixing the issue.

@danwos
Copy link

danwos commented Mar 15, 2022

I haven't tested it a while, as the sphinx-needs related fix is already part of the releases since ~6 months.
So it should work, if you fix the related line.
Please make sure that it's a clean sphinx build and that you open the page in incongito/private mode of your browser, so that no caches are used.

Your method is also the only workaround I know.

To continue the Sphinx-Needs related discussion, please open a new issue in our Sphinx-Needs project, so that this discussion covers the rtd-related part only.

@JochenKienzle
Copy link
Author

JochenKienzle commented Apr 11, 2022

@danwos
What works for me is to unset the overflow property for wy-table-responsive for datatables as a customization.

custom.css:

.dataTables_wrapper.no-footer .wy-table-responsive {
    overflow: unset;
}

@abhishek21kt
Copy link

this is fixing up the issue but now the table horizontal scroll is gone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Needed: replication Bug replication is required
Projects
None yet
Development

No branches or pull requests

3 participants