Forum Discussion

kvelicheti's avatar
kvelicheti
Visitor
5 years ago

Add custom css to markdown table

Hi, 

 

I am trying to beautify the description part for api. So i added the markdown tables. But then i am not able to see actual tables properties when it's rendered in the UI. Is there a way i can add css and make it working?

 

Added table as shown below:

----------------------------------------------------------------------------------------------------------------------------------------------

| Sort Mode | Value | Example |
|------------------------- |------------ |------------------------------------------------------------------ |
| Ascending | **asc** | `?order_by=database_name::asc` |
| Descending | **desc** | `?order_by=tp_account_id::desc` |
| Sort on multiple fields | **&#124;** | <code>?order_by=database_name::asc&#124;total_count::desc</code> |

 

----------------------------------------------------------------------------------------------------------------------------------------------

Attached screenshot of the UI.

 

Thanks in advance

  • In order to apply custom css, I believe you would need to build your own version of SwaggerUI, then implement new css rules. You could also build a plugin to replace the component that you would like to change. The plugin would supercede the SwaggerUI version. I would recommend using SwaggerUI's plugin system rather than make changes to SwaggerUI itself, as it would be easier to stay updated with new releases. For more information, here is some documentation on customization: https://swagger.io/docs/open-source-tools/swagger-ui/customization/overview/

  • tlai's avatar
    tlai
    SmartBear Alumni (Retired)

    In order to apply custom css, I believe you would need to build your own version of SwaggerUI, then implement new css rules. You could also build a plugin to replace the component that you would like to change. The plugin would supercede the SwaggerUI version. I would recommend using SwaggerUI's plugin system rather than make changes to SwaggerUI itself, as it would be easier to stay updated with new releases. For more information, here is some documentation on customization: https://swagger.io/docs/open-source-tools/swagger-ui/customization/overview/