Expand my Community achievements bar.

SOLVED

Change Table Component Default HTML

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Administrator

You can overlay the component as per your need or you can use any Jquery/JS Table plugin and can use in the page.

See Overlays



Kautuk Sahni

View solution in original post

2 Replies

Avatar

Level 10

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.

Avatar

Correct answer by
Administrator

You can overlay the component as per your need or you can use any Jquery/JS Table plugin and can use in the page.

See Overlays



Kautuk Sahni