Magento 2 – Add CSS Class to Admin UI Grid Column

admincssgridmagento2uicomponent

I need to add some css rules to one of the columns of my custom admin ui grid. Is there a way to add css class to it from listing xml file?

Best Answer

Sure, just add "fieldClass" property to the column configuration:

<column name="column_name">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="fieldClass" xsi:type="string">your-css-rule(s)</item>
        </item>
    </argument>
</column>