Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Table component in AEM

Avatar

Level 6

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!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 1
Level 1

<!-- /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>