Change Table Component Default HTML

Liannus 30-10-2018

I'm working in AEM sites 6.2 and am looking for a way to edit the automatically generated html of the table component. If I generate a base 3x2 table I am provided with this:

<table cellspacing="0" cellpadding="1" border="1">

     <tbody>

          <tr>

               <td> </td>

               <td> </td>

               <td> </td>

          </tr>

          <tr>

               <td> </td>

               <td> </td>

               <td> </td>

          </tr>

     </tbody>

</table>

But am looking for a way to change the <td> tags to something like <td role="cell"> to provide accessibility by default. I have noticed that the HTML is stored in the "tableData" property in the tables JCR node but I don't know when or where that "tableData" property is generated.

I can currently add the RTE plugin for editing raw html and add all the attributes manually but I figure there must be a better way around it.

Accepted Solutions (1)

Accepted Solutions (1)

Answers (1)

Answers (1)

smacdonald2008 31-10-2018

Are you referring to this component in 6.2?

/libs/foundation/components/table

Like all AEM components - you can look into overlaying this component to add your own business logic.