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

Pasting a table that contains thead tag leads to column spanning issues #7688

Closed
bperson opened this issue Jul 3, 2018 · 3 comments
Closed
Labels
[Feature] Paste [Type] Bug An existing feature does not function as intended

Comments

@bperson
Copy link

bperson commented Jul 3, 2018

Describe the bug
Pasting a table that contains thead leads to column spanning issues: the first column defined in the thead will be spanned across all the columns defined in the tbody, any extra column in the thead are then appended as if they were "extra" columns. ( see the screenshots below, describing column spanning issues is a pain 😅 )

To Reproduce
Steps to reproduce the behavior:

  1. Copy and Paste a table containing a thead tag ( for instance from a GitHub README )
  2. The thead is preserved in the HTML with its children, but it creates layout / column spanning issues

Expected behavior
Either filter out the thead when copy-pasting
OR
Proper support of thead in tables

Screenshots
screen shot 2018-07-03 at 13 16 45
screen shot 2018-07-03 at 13 17 00

Desktop (please complete the following information):

  • OS: macOS 10.13.4
  • Browser Chrome
  • Version 67.0.3396.99

Additional context
Tried on p2s and on frontenberg so, I'm guessing the latest?
It's potentially a duplicate of #6902

@designsimply designsimply added [Type] Bug An existing feature does not function as intended [Feature] Paste labels Jul 5, 2018
@designsimply
Copy link
Member

Tested and confirmed with WordPress 4.9.6 and Gutenberg 3.1.1 using Safari 11.1.1 on macOS 10.13.5 with the following sample html:

<table>
<thead>
<tr>
<th>Acronym</th>
<th>Definition</th>
</tr>
</thead>
<tbody>
<tr>
<td>RC</td>
<td>Row Count</td>
</tr>
<tr>
<td>TS</td>
<td>Total Byte Size</td>
</tr></tbody></table>

screen shot 2018-07-04 at wed jul 4 6 29 26 pm
Seen at http://alittletestblog.com/wp-admin/post.php?post=13878&action=edit running WordPress 4.9.6 and Gutenberg 3.1.1 using Safari 11.1.1 on macOS 10.13.5.

screen shot 2018-07-04 at wed jul 4 6 31 37 pm
Seen at http://alittletestblog.com/2018/07/05/thead-tag-test/ running WordPress 4.9.6 and Gutenberg 3.1.1 using Safari 11.1.1 on macOS 10.13.5.

I noticed that <table> becomes <table class="wp-block-table"> and removing class="wp-block-table" from <table class="wp-block-table"> on the front end makes the column spanning issue go away.

@marcusig
Copy link

marcusig commented Jul 25, 2018

Just noticed the same issue in v3.3.0

The issue is here:

.wp-block-table tbody {
    width: 100%;
    display: table;
    min-width: 240px;
}

tbody display property shouldn't be set to table.

I think the best would be to leave the display property empty, or set it to the default table-row-group if really necessary.

@ianbelanger79
Copy link
Contributor

PR #7899 fixes this issue so I am closing this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Paste [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants