Skip to content

Fashion Presets

Fashion presets control the overall table appearance: borders, spacing, fonts, and background. Apply one fashion per table — the last call wins.

Most fashion methods take no parameters. The exception is fashion_zebra, which accepts optional row colours — see below. All return a new Styler.


fashion_grid()

Clean white table with visible grid lines. Excel-like appearance. Good default for data exploration.

df.style().gradient("Math", cmap="Blues 2").fashion_grid().show()
Country Reading Math Science GDP_per_capita
Estonia 511 510 526 27.9
Ireland 516 492 504 99.1
Poland 489 489 513 18.7
Finland 490 484 511 53.1
Netherlands 459 493 488 58.3

fashion_zebra(fill1=None, fill2=None)

Alternating row colours, no grid lines. Improves readability for wide tables.

  • fill1 str | None, default "white" — Colour for odd rows
  • fill2 str | None, default "#f2f2f2" — Colour for even rows
df.style().gradient("Math", cmap="Blues 2").fashion_zebra().show()
Country Reading Math Science GDP_per_capita
Estonia 511 510 526 27.9
Ireland 516 492 504 99.1
Poland 489 489 513 18.7
Finland 490 484 511 53.1
Netherlands 459 493 488 58.3
df.style().gradient("Math", cmap="Blues 2").fashion_zebra(fill1="white", fill2="#e8f4f8").show()
Country Reading Math Science GDP_per_capita
Estonia 511 510 526 27.9
Ireland 516 492 504 99.1
Poland 489 489 513 18.7
Finland 490 484 511 53.1
Netherlands 459 493 488 58.3

fashion_raw()

Minimal styling that mimics Polars' default print output. No background colours or borders.

df.style().gradient("Math", cmap="Blues 2").fashion_raw().show()
Country Reading Math Science GDP_per_capita
Estonia 511 510 526 27.9
Ireland 516 492 504 99.1
Poland 489 489 513 18.7
Finland 490 484 511 53.1
Netherlands 459 493 488 58.3

fashion_scientific()

Publication-style booktabs table: top/bottom rules, mid-rule below header, no vertical lines. Pair with .caption() for a proper figure caption.

df.style().gradient("Math", cmap="Blues 2").fashion_scientific().show()
Country Reading Math Science GDP_per_capita
Estonia 511 510 526 27.9
Ireland 516 492 504 99.1
Poland 489 489 513 18.7
Finland 490 484 511 53.1
Netherlands 459 493 488 58.3

fashion_minimal()

Clean, borderless table with subtle header styling. Good for dashboards and web embedding.

df.style().gradient("Math", cmap="Blues 2").fashion_minimal().show()
Country Reading Math Science GDP_per_capita
Estonia 511 510 526 27.9
Ireland 516 492 504 99.1
Poland 489 489 513 18.7
Finland 490 484 511 53.1
Netherlands 459 493 488 58.3

fashion_compact()

Tight row spacing to display more data in less space. Useful for dense numeric tables.

df.style().gradient("Math", cmap="Blues 2").fashion_compact().show()
Country Reading Math Science GDP_per_capita
Estonia 511 510 526 27.9
Ireland 516 492 504 99.1
Poland 489 489 513 18.7
Finland 490 484 511 53.1
Netherlands 459 493 488 58.3

fashion_presentation()

Spacious layout with large fonts and high contrast. Designed for slides and presentations.

df.style().gradient("Math", cmap="Blues 2").fashion_presentation().show()
Country Reading Math Science GDP_per_capita
Estonia 511 510 526 27.9
Ireland 516 492 504 99.1
Poland 489 489 513 18.7
Finland 490 484 511 53.1
Netherlands 459 493 488 58.3