Change Table Component Default HTML | Community
Skip to main content
Level 2
October 30, 2018
Solved

Change Table Component Default HTML

  • October 30, 2018
  • 2 replies
  • 1035 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

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

2 replies

smacdonald2008
Level 10
October 31, 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.

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
November 13, 2018

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