Not able to add CSS Class to TD

  • 1
  • Question
  • Updated 2 years ago
In table component i have selected field and mentioned class name to add, but the class is not displaying after the page rendering. It seems that mentioned class not added to td or field..
Photo of Vijayakrishna

Vijayakrishna

  • 642 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
When I'm trying to target a specific element for custom CSS, I will often start by inspecting the element on the page preview with the browser's console, and adding the desired CSS where I think it should be using the browser console, so that I can see the CSS changes work. Then, I'll know more about which element to target with the CSS rules. Working 'backwards' like this can help because sometimes there are HTML elements nested inside each other, and targeting the right element needs a certain kind of specificity that isn't obvious when you're working in the page builder. What can happen, for example, is that the custom CSS rules end up being applied to the parent of the element you're interested, or the element's child.