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

Wrong even/odd rows in nested tables #9710

Closed
mccoys opened this issue Oct 6, 2021 · 0 comments
Closed

Wrong even/odd rows in nested tables #9710

mccoys opened this issue Oct 6, 2021 · 0 comments

Comments

@mccoys
Copy link

mccoys commented Oct 6, 2021

A table inside another table messes with the even/odd count of the parent table rows.

.. rst-class:: fancy

+------------------------------+
| SOME TITLE ...............   |
+------------------------------+
| +--------------------------+ |
| | Item 1                   | |
| +--------------------------+ |
| | Item 1                   | |
| +--------------------------+ |
| | Item 1                   | |
| +--------------------------+ |
+------------------------------+
| ANOTHER TITLE  ...........   |
+------------------------------+
| +--------------------------+ |
| | Item 1                   | |
| +--------------------------+ |
| | Item 1                   | |
| +--------------------------+ |
+------------------------------+

Gives this result:

<table class="fancy docutils align-default">
    <colgroup>
        <col style="width: 100%">
    </colgroup>
    <tbody>
        <tr class="row-odd"><td><p>SOME TITLE ……………</p></td><!-- This is odd -->
        </tr>
        <tr class="row-even"><td> <!-- This is even -->
            
            <table class="docutils align-default">
                <colgroup>
                    <col style="width: 100%">
                </colgroup>
                <tbody>
                    <tr class="row-odd"><td><p>Item 1</p></td>
                    </tr>
                    <tr class="row-even"><td><p>Item 1</p></td>
                    </tr>
                    <tr class="row-odd"><td><p>Item 1</p></td>
                    </tr>
                </tbody>
            </table>
            </td>
            
        </tr>
        <tr class="row-even"><td><p>ANOTHER TITLE  ………..</p></td> <!-- This is even but should be odd -->
        </tr>
        <tr class="row-odd"><td>
            
            <table class="docutils align-default">
                <colgroup>
                    <col style="width: 100%">
                </colgroup>
                <tbody>
                    <tr class="row-odd"><td><p>Item 1</p></td>
                    </tr>
                    <tr class="row-even"><td><p>Item 1</p></td>
                    </tr>
                </tbody>
            </table>
            
            </td>
        </tr>
    </tbody>
</table>

The inner table numbering has overwritten the outer table numbering.

How to Reproduce

$ git clone https://github.com/mccoys/EvenOddSphinx.git
$ cd EvenOddSphinx
$ make html

Open build/index.html and look at the table odd/even rows.

Expected behavior

Even/odd numbering of inner tables should be counted with a different variable than that of the outer table

Info

  • linux ubuntu 21.04
  • python 3.9.5
  • sphinx 3.5.4 (seen also with 4.2.0)
@mccoys mccoys added the type:bug label Oct 6, 2021
@tk0miya tk0miya added this to the 4.3.0 milestone Oct 6, 2021
tk0miya added a commit to tk0miya/sphinx that referenced this issue Oct 9, 2021
tk0miya added a commit that referenced this issue Oct 10, 2021
Fix #9710: html: Wrong styles for even/odd rows in nested tables
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants