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