Table component in AEM | Community
Skip to main content
Level 6
May 28, 2021
Solved

Table component in AEM

  • May 28, 2021
  • 2 replies
  • 2907 views

I am using AEM 6.5 AND i have a component in which RTE plugin is available for the description field. Through this RTE I can add table to my description. I wanted to have some enhacements like adding color to cell background, font color, alignment etc.

Can someone suggest best approach for this? 

Thanks ahead!

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 arunpatidar

Not sure if you can use custom styling plugin to add styling to cell, row, table using css

https://aemlab.blogspot.com/2019/07/aem-rte-custom-plugins-1.html

 

2 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
May 28, 2021

Not sure if you can use custom styling plugin to add styling to cell, row, table using css

https://aemlab.blogspot.com/2019/07/aem-rte-custom-plugins-1.html

 

Arun Patidar
July 19, 2024

<!-- /apps/your-project/components/custom-table/custom-table.html -->
<div class="custom-table">
<table>
<thead>
<tr>
<!-- Generate table headers -->
<sly data-sly-use.table="com.example.CustomTable">
<sly data-sly-repeat.header="${table.getHeaders()}">
<th>${header}</th>
</sly>
</sly>
</tr>
</thead>
<tbody>
<!-- Generate table rows and columns based on the provided data -->
<sly data-sly-use.table="com.example.CustomTable">
<sly data-sly-repeat.row="${table.getRows()}">
<tr>
<sly data-sly-repeat.col="${table.getColumns()}">
<td>Row ${row.index + 1}, Col ${col.index + 1}</td>
</sly>
</tr>
</sly>
</sly>
</tbody>
</table>
</div>