Alternating column colors for simple table | Experience Community
Skip to main content
Question

Alternating column colors for simple table

  • March 10, 2026
  • 1 reply
  • 18 views

Forum|alt.badge.img

Hello, how can I apply alternating gray and white to the baseline, mid-year and year-end columns? I found a lot of questions for matrix, but not much for a basic table created using rich content editor. 

Thank you!

 

1 reply

nikamshubham73
Level 2 ●●
Forum|alt.badge.img+2

Hi ​@fdiste,

Inside the Rich Content Editor, you will see a Source option. When you click on it, the HTML code of your table will be displayed. You need to declare a class and apply it to the table, and then define the styling within that class so you can highlight the column headers.

<style>
/* Create a class".table-style" that will help you find the Rows and Columns in Table */
.table-style {
  Add all the properties you want for the table
}

/* Grey background for specific column headers, if you want to highlight for whole column, replace th with td */
.table-style th:nth-child(2),
.table-style th:nth-child(3),
.table-style th:nth-child(4) {
  background-color: #808080;

}

</style>


/* Make sure you declare the class and add your table Structure */
<table class="table-style">
<tr>
Your Table in HTML
</tr>
</table>

  • .table-style applies styling to the entire table element that has the class table-style.

  • .table-style th applies styling specifically to the header cells (th) within the table that has the class table-style.

  • .table-style td applies styling to the data cells (td) inside the table that has the class table-style.