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

First column header throws error #15

Open
Vertigrator opened this issue May 5, 2021 · 3 comments
Open

First column header throws error #15

Vertigrator opened this issue May 5, 2021 · 3 comments

Comments

@Vertigrator
Copy link

When the first column of the table is set as a header it throws this error:
Uncaught TypeError: can't access property "text", a[e][t] is undefined

Example table below:
<table class="ms-rteTable-5" width="100%" cellspacing="0"><tbody><tr class="ms-rteTableEvenRow-5"><th class="ms-rteTableFirstCol-5" rowspan="1" colspan="1" style="width:16.6667%;" data-th="​Wast​e (Tonnes): ​2011-12: ​2012-13: ​2013-14: ​2014-15"><span class="bt-content">​Wast​e (Tonnes)<br></span></th><td class="ms-rteTableOddCol-5" rowspan="1" colspan="1" style="width:16.6667%;">​Landfilled</td><td class="ms-rteTableEvenCol-5" rowspan="1" colspan="1" style="width:16.6667%;">​Recycled</td><td class="ms-rteTableOddCol-5" rowspan="1" colspan="1" style="width:16.6667%;">​Composted</td><td class="ms-rteTableEvenCol-5" rowspan="1" colspan="1" style="width:16.6667%;">​Generated</td><td class="ms-rteTableOddCol-5" rowspan="1" colspan="1" style="width:16.6667%;">​Recovered</td></tr><tr class="ms-rteTableOddRow-5"><th class="ms-rteTableFirstCol-5" rowspan="1" colspan="1">​2011-12</th><td class="ms-rteTableOddCol-5">​460,467</td><td class="ms-rteTableEvenCol-5">​159,633</td><td class="ms-rteTableOddCol-5">​41,298</td><td class="ms-rteTableEvenCol-5">​661,398</td><td class="ms-rteTableOddCol-5" rowspan="1" colspan="1">​30.4%</td></tr><tr class="ms-rteTableEvenRow-5"><th class="ms-rteTableFirstCol-5" rowspan="1" colspan="1">​2012-13</th><td class="ms-rteTableOddCol-5">​471,921</td><td class="ms-rteTableEvenCol-5">​182,193</td><td class="ms-rteTableOddCol-5">​41,748</td><td class="ms-rteTableEvenCol-5">​696,861</td><td class="ms-rteTableOddCol-5" rowspan="1" colspan="1">​32.3%</td></tr><tr class="ms-rteTableOddRow-5"><th class="ms-rteTableFirstCol-5" rowspan="1" colspan="1">​2013-14</th><td class="ms-rteTableOddCol-5">​398,603</td><td class="ms-rteTableEvenCol-5">​200​​,380<br></td><td class="ms-rteTableOddCol-5">​37,642</td><td class="ms-rteTableEvenCol-5">​636,625</td><td class="ms-rteTableOddCol-5" rowspan="1" colspan="1">​37.4%</td></tr><tr class="ms-rteTableEvenRow-5"><th class="ms-rteTableFirstCol-5" rowspan="1" colspan="1">​2014-15</th><td class="ms-rteTableOddCol-5" rowspan="1">​415,443</td><td class="ms-rteTableEvenCol-5" rowspan="1">​194,170</td><td class="ms-rteTableOddCol-5" rowspan="1">​39,350</td><td class="ms-rteTableEvenCol-5" rowspan="1">​648,964</td><td class="ms-rteTableOddCol-5" rowspan="1" colspan="1">​36.0%</td></tr></tbody></table>

@jerrylow
Copy link
Owner

Ah I see the issue here. You have an unfortunately there's no support for column headers yet as a duplicate with #10. Open for a PR but I haven't had time to get around to this. The structure I'm eying to support will be https://www.w3.org/WAI/tutorials/tables/two-headers/

@Vertigrator
Copy link
Author

We have made the decision to avoid having tables with column headers as a workaround. But it would be nice if this support was added at some point.

@Vertigrator
Copy link
Author

If there is a way you can catch the error with a try/catch then at least other Javascript on the page would continue to run, even if the table can't be made responsive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants