Any configuration option to create cleaner tables?


(Douglas (@finnatic at @waikato)) #1

Matrix Version: 5.4.5.1

I’m migrating some content which is in tabular form, and using the WYSIWYG content type to support authors who I don’t want to immediately challenge with having to understand HTML.

Matrix, as it is wont to do, is kindly auto-generating and inserting id attributes into each of my table header cells (th) and and headers attributes into each of my table body cells (td).

Is there anyway, short of converting it to a raw html content type that I can just disable the autogenerated attributes?

I’ve found that if I manually adjust the autogenerated id values on the table headers, that will influence the autogenerated headers attribute values. That works somewhat, but the page in question is fill of tables, so I’m having to carefully set each and every id value to be unique.


(Bart Banda) #2

There is no way to turn this off using a simple setting, but I’m keen to understand more around why this is a problem? Isn’t it a good thing that automatic IDs are generated?


(Douglas (@finnatic at @waikato)) #3

Not everyone is necessarily following WCAG 2, and I’m not sure that the Matrix WYSIWYG implementation necessarily supports the full procedure outlined on https://www.w3.org/TR/WCAG20-TECHS/H43.html - which allows two cases where you don’t have id and header attributes on tables :

Check for layout tables: determine whether the content has a relationship with other content in both its column and its row. If “no," the table is a layout table. If “yes," the table is a data table.

For data tables, check that any cell that is associated with more than one row and/or one column header contains a headers attribute that lists the id for all headers associated with that cell.

(Bart Banda) #4

Layout tables are probably not a common thing anymore are they? That’s what

s and CSS is meant to be used for?

But regardless, even if the IDs are there in the tables that are used for layouts (or the other use case which I’m not actually clear on), is that a bad thing? Is there any negative impact of having ID references anyway? Just trying to understand the problem a bit more.


(Douglas (@finnatic at @waikato)) #5

I think I found my own solution somewhat as per the O/P - if you customise the table and table header ids then Matrix will regenerate based on those values so that you can get :

<table id='facilities-contacts'
...
<th id="fc-role"
...
<td headers="fc-role">

instead of:

<td headers="table11132r1c2">

The autogenerated … aren’t so pretty or semantic. Interesting to see the table tool doesn’t prompt for a table id?