Open heartoforchid opened 3 months ago
Could you properly format your post using code blocks for code and terminal outputs? Thanks.
If your code contains code blocks, you need to enclose it using more backticks, i.e., usually four ````
.
See https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us.
---
title: "Reproducible Quarto Document"
format: html
engine: jupyter
---
```{python}
import pandas as pd
# Define the color scheme
deep_red = '#FF0000'
light_red = '#FFC7CE'
white = '#FFFFFF'
light_green = '#C6EFCE'
deep_green = '#00B050'
# Create a simple DataFrame to demonstrate the issue
data = {
'Index': ['Equities (%)', 'Fixed Income (bps)'],
'1W': [5, -1],
'YTD': [10, -3]
}
df = pd.DataFrame(data)
# Function to highlight cells based on values
def highlight_cells(val):
if val < 0:
return f'background-color: {light_red}; color: black'
elif val == 0:
return f'background-color: {white}; color: black'
elif val > 0:
return f'background-color: {light_green}; color: black'
# Apply styling
styled_df = df.style.applymap(highlight_cells, subset=['1W', 'YTD'])
# Display styled DataFrame
styled_df
[Here is the reference doc] custom-reference-doc.docx
@heartoforchid Simply edit your original post to make it legible.
Bug description
I use Pandas Styler to display a table in a colored fashion. Quarto returns a non-colored table while the code works correctly in other settings
Steps to reproduce
[Here is the reference doc] custom-reference-doc.docx
Quarto 1.5.46 [✓] Checking versions of quarto binary dependencies... Pandoc version 3.2.0: OK Dart Sass version 1.70.0: OK Deno version 1.41.0: OK Typst version 0.11.0: OK [✓] Checking versions of quarto dependencies......OK [✓] Checking Quarto installation......OK Version: 1.5.46 Path: /Applications/quarto/bin
[✓] Checking tools....................OK TinyTeX: (external install) Chromium: (not installed)
[✓] Checking LaTeX....................OK Using: TinyTex Path: /Users/lacey/Library/TinyTeX/bin/universal-darwin Version: 2023
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK Version: 3.8.19 (Conda) Path: /opt/anaconda3/bin/python Jupyter: 5.7.2 Kernels: python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........OK Version: 4.3.2 Path: /Library/Frameworks/R.framework/Resources LibPaths:
[✓] Checking Knitr engine render......OK