cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issues in visualizing tables when exporting dashboard to HTML

JZhang
New Contributor

Hello community

I am facing an issue when I export a dashboard to an HTML: the problem is that the HTML has white background but the exported tables have black colors, like the example I am showing below 

JZhang_0-1740495725310.png

Does someone know how to handle this visualization issue? 

 

Many thanks for any help

1 REPLY 1

mark_ott
Databricks Employee
Databricks Employee

To resolve the issue of dashboard tables exporting to HTML with mismatched colors—specifically black table backgrounds against a white HTML page—review and adjust your dashboard’s CSS or formatting settings before export. The problem typically occurs because the style for tables is either set to dark (perhaps for display mode) or is missing necessary overrides for HTML exports. Ensuring that the table’s background and text color settings align with your HTML export background is key.​

Common Solutions

  • Add or override CSS rules in the exported HTML to set the table’s background and text colors explicitly. For example, within a <style> block, specify:

    text
    table { background: white !important; color: black !important; }

    This forces tables to display with white backgrounds regardless of their original theme or styling.​

  • If your dashboard software allows theme selection or export settings, ensure it uses a “light” theme when exporting to HTML.​

  • Inline CSS or styling directly in the table tags can be overwritten by global CSS—instead, use classes or IDs for greater control. Assign a class to your table, then target it in your stylesheet:

    text
    <table class="exported-table"> ... </table>

    And in your CSS:

    text
    .exported-table { background: white; color: black; }

    This approach is recommended over using inline styles for maintainability and consistency.​

Troubleshooting Steps

  • Inspect the exported HTML using browser developer tools (e.g., Chrome DevTools) to identify conflicting styles or inherited properties from your dashboard platform. Override undesired styles as needed.​

  • If your dashboard export tool produces inline styles or uses a stylesheet that isn’t customizable, manually edit the HTML or reference a separate CSS file to fix color issues.​

  • Some platforms (like Splunk, Power BI, Tableau, etc.) may require specific steps for exporting with color fidelity. Consult product-specific forums or documentation if native export methods do not honor your expected color scheme.​

Example CSS Fix

xml
<style> table, th, td { background: white !important; color: black !important; } </style>

Insert this snippet at the beginning of your HTML file to standardize table appearance on the exported page.​

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now