great-tables-4-conditional-formatting
Sub-skill of great-tables: 4. Conditional Formatting.
Best use case
great-tables-4-conditional-formatting is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Sub-skill of great-tables: 4. Conditional Formatting.
Teams using great-tables-4-conditional-formatting should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/4-conditional-formatting/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How great-tables-4-conditional-formatting Compares
| Feature / Agent | great-tables-4-conditional-formatting | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Sub-skill of great-tables: 4. Conditional Formatting.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 4. Conditional Formatting
## 4. Conditional Formatting
**Color Scales:**
```python
from great_tables import GT
from great_tables import style, loc
from great_tables.data import countrypops
import pandas as pd
# Sample heatmap data
df = pd.DataFrame({
"Month": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
"North": [85, 92, 88, 95, 91, 97],
"South": [72, 78, 81, 75, 82, 88],
"East": [90, 85, 92, 89, 94, 91],
"West": [68, 75, 79, 82, 78, 85]
})
table = (
GT(df)
.tab_header(title="Regional Performance Scores")
# Apply color scale to data columns
.data_color(
columns=["North", "South", "East", "West"],
palette=["#FF6B6B", "#FFEB3B", "#4CAF50"], # Red -> Yellow -> Green
domain=[60, 100]
)
)
table.save("color_scale.html")
```
**Conditional Icons:**
```python
from great_tables import GT, html
import pandas as pd
df = pd.DataFrame({
"Metric": ["Revenue", "Users", "Conversion", "NPS"],
"Current": [1250000, 85000, 3.2, 72],
"Previous": [1180000, 78000, 3.5, 68],
"Change_Pct": [5.9, 9.0, -8.6, 5.9]
})
def trend_icon(value):
"""Return trend icon based on value."""
if value > 0:
return html('<span style="color: green;">▲</span>') # Up arrow
elif value < 0:
return html('<span style="color: red;">▼</span>') # Down arrow
else:
return html('<span style="color: gray;">▶</span>') # Right arrow
# Add trend column
df["Trend"] = df["Change_Pct"].apply(trend_icon)
table = (
GT(df)
.tab_header(title="Key Metrics Dashboard")
.fmt_number(columns="Current", use_seps=True, decimals=0)
.fmt_number(columns="Previous", use_seps=True, decimals=0)
.fmt_percent(columns="Change_Pct", decimals=1, scale_values=False)
)
table.save("conditional_icons.html")
```
**Bar Charts in Cells:**
```python
from great_tables import GT, html
import pandas as pd
df = pd.DataFrame({
"Product": ["Alpha", "Beta", "Gamma", "Delta", "Epsilon"],
"Sales": [85000, 120000, 65000, 95000, 110000],
"Target": [100000, 100000, 100000, 100000, 100000]
})
def create_bar(value, max_value=150000):
"""Create inline bar chart."""
width = min(value / max_value * 100, 100)
color = "#4CAF50" if value >= 100000 else "#FF9800"
return html(f'''
<div style="background: #eee; width: 100px; height: 20px;">
<div style="background: {color}; width: {width}%; height: 100%;"></div>
</div>
''')
df["Progress"] = df["Sales"].apply(create_bar)
table = (
GT(df)
.tab_header(title="Sales Progress by Product")
.fmt_number(columns="Sales", use_seps=True, decimals=0)
.fmt_number(columns="Target", use_seps=True, decimals=0)
)
table.save("bar_charts.html")
```Related Skills
n8n-4-conditional-branching-and-error-handling
Sub-skill of n8n: 4. Conditional Branching and Error Handling.
activepieces-4-branching-and-conditional-logic
Sub-skill of activepieces: 4. Branching and Conditional Logic.
doc-extraction-naval-architecture-structural-scantling-tables
Sub-skill of doc-extraction-naval-architecture: Structural Scantling Tables.
python-pptx-2-advanced-text-formatting
Sub-skill of python-pptx: 2. Advanced Text Formatting.
python-docx-3-table-creation-and-formatting
Sub-skill of python-docx: 3. Table Creation and Formatting.
python-docx-2-advanced-paragraph-formatting
Sub-skill of python-docx: 2. Advanced Paragraph Formatting.
openpyxl-2-advanced-cell-formatting
Sub-skill of openpyxl: 2. Advanced Cell Formatting.
docx-templates-3-conditional-content
Sub-skill of docx-templates: 3. Conditional Content.
data-visualization-number-formatting-helpers
Sub-skill of data-visualization: Number Formatting Helpers (+1).
great-tables-great-tables-with-streamlit
Sub-skill of great-tables: Great Tables with Streamlit (+1).
great-tables-6-footnotes-and-annotations
Sub-skill of great-tables: 6. Footnotes and Annotations (+1).
great-tables-5-grouped-rows-and-columns
Sub-skill of great-tables: 5. Grouped Rows and Columns.