diff --git a/a-latex_examples/index.pdf b/a-latex_examples/index.pdf index b47f17892..abbadacb8 100644 Binary files a/a-latex_examples/index.pdf and b/a-latex_examples/index.pdf differ diff --git a/blog/bring-your-own-df/index.html b/blog/bring-your-own-df/index.html index ee027049a..4558794de 100644 --- a/blog/bring-your-own-df/index.html +++ b/blog/bring-your-own-df/index.html @@ -252,7 +252,7 @@

The

The challenge of removing hard dependencies

Removing hard dependencies on DataFrame libraries is worthwhile, but requires special handling for all DataFrame specific actions. To illustrate consider the Great Tables output below, which is produced from a Pandas DataFrame:

-
+
import pandas as pd
 import polars as pl
 from great_tables import GT
@@ -262,52 +262,52 @@ 

GT(df_pandas)

-
+
@@ -345,7 +345,7 @@

Getting column names

The code below shows the different methods required to get column names as a list from Pandas and Polars.

-
+
df_pandas.columns.tolist()  # pandas
 df_polars.columns           # polars
@@ -353,7 +353,7 @@

Getting column names<

Notice that the two lines of code aren’t too different—Pandas just requires an extra .tolist() piece. We could create a special function, that returns a list of names, depending on the type of the input DataFrame.

-
+
def get_column_names(data) -> list[str]:
 
     # pandas specific ----
@@ -380,7 +380,7 @@ 

How we made Pa

Inverting dependency with databackend

Inverting dependency on DataFrame libraries means that we check whether something is a specific type of DataFrame, without using imports. This is done through the package databackend, which we copied into Great Tables.

It works by creating placeholder classes, which stand in for the DataFrames they’re detecting:

-
+
from great_tables._databackend import AbstractBackend
 
 
@@ -409,7 +409,7 @@ 

Inve

Separating concerns with singledispatch

While databackend removes dependencies, the use of singledispatch from the built-in functools module separates out the logic for handling Polars DataFrames from the logic for Pandas DataFrames. This makes it easier to think one DataFrame at a time, and also gets us better type hinting.

Here’s a basic example, showing the get_column_names() function re-written using singledispatch:

-
+
from functools import singledispatch
 
 
@@ -440,7 +440,7 @@ 

Se
  • The use of PdDataFrame is what signifies “run this for Pandas DataFrames”.
  • With the get_column_names implementations defined, we can call it like a normal function:

    -
    +
    get_column_names(df_pandas)  # pandas version
     get_column_names(df_polars)  # polars version
    diff --git a/blog/design-philosophy/index.html b/blog/design-philosophy/index.html index dec94868d..430df895c 100644 --- a/blog/design-philosophy/index.html +++ b/blog/design-philosophy/index.html @@ -238,54 +238,54 @@

    What is a table, re
  • the data is primarily text
  • Let’s look at an example of a simple table with actual data to tie this theory to practice.

    -
    +
    -
    +

    @@ -451,7 +451,7 @@

    A
  • Table Footer: a place for additional information pertaining to the table content
  • Here’s a table that takes advantage of the different components available in Great Tables. It contains the names and addresses of people.

    -
    +
    Show the code
    from great_tables import GT, md, system_fonts
    @@ -475,52 +475,52 @@ 

    A )

    -
    +

    @@ -623,7 +623,7 @@

    Formatting

  • a compact integer value (fmt_integer()): 134K
  • The problem grows worse when values need to be conveyed as images or plots. If you’re a medical analyst, for example, you might need to effectively convey whether test results for a patient are improving or worsening over time. Reading such data as a sequence of numbers across a row can slow interpretation. But by using nanoplots, available as the fmt_nanoplot() formatting method, readers can spot trends right away. Here’s an example that provides test results over a series of days.

    -
    +
    Show the code
    from great_tables import GT, md
    @@ -651,52 +651,52 @@ 

    Formatting

    )
    -
    +
    diff --git a/blog/index.html b/blog/index.html index 681ec9e11..38bcd445e 100644 --- a/blog/index.html +++ b/blog/index.html @@ -267,7 +267,7 @@

    Great Blogposts

    - + @@ -278,7 +278,7 @@

    Great Blogposts

    Rich Iannone
    - + @@ -289,7 +289,7 @@

    Great Blogposts

    Michael Chow
    - + @@ -300,7 +300,7 @@

    Great Blogposts

    Jerry Wu
    - + @@ -311,7 +311,7 @@

    Great Blogposts

    Rich Iannone
    - + @@ -322,7 +322,7 @@

    Great Blogposts

    Rich Iannone and Michael Chow
    - + @@ -333,7 +333,7 @@

    Great Blogposts

    Rich Iannone
    - + @@ -344,7 +344,7 @@

    Great Blogposts

    Rich Iannone
    - + @@ -355,7 +355,7 @@

    Great Blogposts

    Michael Chow
    - + @@ -366,7 +366,7 @@

    Great Blogposts

    Michael Chow
    - + @@ -377,7 +377,7 @@

    Great Blogposts

    Rich Iannone and Michael Chow
    - + @@ -388,7 +388,7 @@

    Great Blogposts

    Rich Iannone
    - + @@ -399,7 +399,7 @@

    Great Blogposts

    Rich Iannone
    - + @@ -410,7 +410,7 @@

    Great Blogposts

    Michael Chow
    - + @@ -421,7 +421,7 @@

    Great Blogposts

    Rich Iannone
    - + @@ -432,7 +432,7 @@

    Great Blogposts

    Michael Chow
    - + diff --git a/blog/index.xml b/blog/index.xml index d2b39efa9..c6923c4db 100644 --- a/blog/index.xml +++ b/blog/index.xml @@ -31,7 +31,7 @@

    Using fmt_flag() to incorporate country flag icons

    When tables contain country-level data, having a more visual representation for a country can help the reader more quickly parse the table contents. The new fmt_flag() method makes this easy to accomplish. You just need to have either two-letter country codes or three-letter country codes in a column.

    Here’s an example where country flags, shown as simplified circular icons, can be added to a table with fmt_flag():

    -
    +
    from great_tables "Zip/Postcode",
         )
     )
    -
    +
    Dec 19, 2024
    Dec 19, 2024
    Dec 13, 2024
    Nov 13, 2024
    Oct 10, 2024
    Sep 30, 2024
    Jul 8, 2024
    May 16, 2024
    Apr 24, 2024
    Apr 4, 2024
    Mar 19, 2024
    Feb 16, 2024
    Feb 8, 2024
    Jan 24, 2024
    Jan 8, 2024
    Jan 4, 2024
    @@ -264,7 +264,7 @@ font-style: inherit;">"Zip/Postcode",

    This slice of the peeps dataset has country codes in their 3-letter form (i.e., "USA", "SVN", and "CAN") within the country column. So long as they are correct, fmt_flag() will perform the conversion to flag icons. Also, there’s a little bit of interactivity here: when hovering over a flag, the country name will appear as a tooltip!

    We have the power to display multiple flag icons within a single cell. To make this happen, the country codes need to be combined in a single string where each code is separated by a comma (e.g., "US,DE,GB"). Here’s an example that uses a portion of the films dataset:

    -
    +
    from great_tables "PT Sans"))
     )
    -
    +
    @@ -452,7 +452,7 @@ font-style: inherit;">"PT Sans"))

    Using fmt_icon() to include Font Awesome icons

    The new fmt_icon() method gives you the ability to easily include FontAwesome icons in a table. It uses a similar input/output scheme as with fmt_flag(): provide the short icon name (e.g., "table", "music", "globe", etc.) or a comma-separated list of them, and fmt_icon() will provide the Font Awesome icon in place. Let’s see it in action with an example that uses the metro dataset:

    -
    +
    from great_tables "left")
     )
    -
    +
    @@ -664,7 +664,7 @@ font-style: inherit;">"left")
  • fmt_percent()
  • Here’s a comprehensive example table that demonstrates how this type of formatting looks.

    -
    +
    Show the code
    "percent"
     )
    -
    +
    @@ -1015,7 +1015,7 @@ font-style: inherit;">"percent"

    Why focus on open source in public transit?

    -

    People doing analytics in public transit are active in developing open data standards (like GTFS, GTFS-RT, and TIDES). These open data sources are complex—they cover schedules that change from week to week, busses moving in realtime, and passenger events. As people like me work more and more on open source tools, we start to lose touch with data analysis in realistic, complex settings. Working on open source transit data is an opportunity for me to ensure my open source tooling work helps people solve real, complex problems.

    +

    People doing analytics in public transit are active in developing open data standards (like GTFS, GTFS-RT, and TIDES). These open data sources are complex—they cover schedules that change from week to week, buses moving in realtime, and passenger events. As people like me work more and more on open source tools, we start to lose touch with data analysis in realistic, complex settings. Working on open source transit data is an opportunity for me to ensure my open source tooling work helps people solve real, complex problems.

    An inspiration for this angle is the book R for Data Science, which uses realistic datasets—like NYC flights data—to teach data analysis using an ecosystem of packages called the Tidyverse. The Tidyverse packages have dozens of example datasets, and I think this focus on working through examples is part of what made their design so great.

    A few years ago, I worked with the Cal-ITP project to build out a warehouse for their GTFS schedule and realtime data. This left a profound impression on me: transit data is perfect for educating on data analyses in R and Python, as well as analytics engineering with tools like dbt or sqlmesh. Many analysts in public transit are querying warehouses, which opens up interesting use-cases with tools like dbplyr (in R) and ibis (in Python).

    (I’m also inspired by tools like tidytransit, and other communities like pharmaverse.org.)

    @@ -1031,7 +1031,7 @@ font-style: inherit;">"percent"

    Great Tables data: Paris metro lines

    If you’ve seen the Great Tables documentation for GT.fmt_image(), then you’ve basked in this beautiful example from our Paris metro dataset.

    -
    +
    Code
    "passengers")
     )
    -
    +
    @@ -1248,7 +1248,7 @@ Scheduling a workshop

    Collaboration

    I’m interested in understanding major challenges analytics teams working on public transit face, and the kind of strategic and tooling support they’d most benefit from. If you’re working on analytics in public transit, I would love to hear about what you’re working on, and the tools you use most.

    -

    One topic I’ve discussed with a few agencies is ghost busses, which is when a bus is scheduled but never shows up. This is an interesting analysis because it combines GTFS schedule data with GTFS-RT realtime bus data.

    +

    One topic I’ve discussed with a few agencies is ghost buses, which is when a bus is scheduled but never shows up. This is an interesting analysis because it combines GTFS schedule data with GTFS-RT realtime bus data.

    Another is passenger events (e.g. people tapping on or off a bus). This data is challenging because different vendors data record and deliver this data in different ways. This can make it hard for analysts across agencies to discuss analyses—every analysis is different in its own way.

    @@ -1311,7 +1311,7 @@ Finding the Right Case for Your Needs

    Preparations

    For this demonstration, we’ll use the first five rows of the built-in metro dataset, specifically the name and lines columns.

    To ensure a smooth walkthrough, we’ll manipulate the data (a Python dictionary) directly. However, in real-world applications, such operations are more likely performed at the DataFrame level to leverage the benefits of vectorized operations.

    -
    +
    Show the Code
    """)

    Case 1: Local File Paths

    Case 1 demonstrates how to simulate a column containing strings representing local file paths. We’ll use images stored in the data/metro_images directory of Great Tables:

    -
    +
    1img_local_paths = files("data/metro_images"
    +
    Show the Code
    metro_mini1 
     

    Local file paths can vary depending on the operating system, which makes it easy to accidentally construct invalid paths. A good practice to mitigate this is to use Python’s built-in pathlib module to construct paths first and then convert them to strings. In this example, img_local_paths is actually an instance of pathlib.Path.

    -
    +
    from pathlib # True

    The case1 column is quite lengthy due to the inclusion of img_local_paths. In Case 3, we’ll share a useful trick to avoid repeating the directory name each time—stay tuned!

    For now, let’s use GT.fmt_image() to render images by passing "case1" as the first argument:

    -
    +
    GT(metro_mini1).fmt_image("case1").cols_align(align="case1")
    -
    +
    @@ -1697,7 +1697,7 @@ font-style: inherit;">"case1")

    Case 2: Full HTTP/HTTPS URLs

    Case 2 demonstrates how to simulate a column containing strings representing HTTP/HTTPS URLs. We’ll use the same images as in Case 1, but this time, retrieve them from the Great Tables GitHub repository:

    -
    +
    img_url_paths = "https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images"

    Below is a Pandas DataFrame called metro_mini2, where the case2 column contains full HTTP/HTTPS URLs that we aim to render as images.

    -
    +
    Show the Code
    metro_mini2 "lines"]
     

    The lengthy case2 column issue can also be addressed using the trick shared in Case 3.

    Similarly, we can use GT.fmt_image() to render images by passing "case2" as the first argument:

    -
    +
    GT(metro_mini2).fmt_image("case2").cols_align(align="case2")
    -
    +
    @@ -1917,7 +1917,7 @@ font-style: inherit;">"case2")

    Case 3: Image Names with the path= Argument

    Case 3 demonstrates how to use the path= argument to specify images relative to a base directory or URL. This approach eliminates much of the repetition in file names, offering a solution to the issues in Case 1 and Case 2.

    Below is a Pandas DataFrame called metro_mini3, where the case3 column contains file names that we aim to render as images.

    -
    +
    Show the Code
    metro_mini3 "lines"]
     

    Now we can use GT.fmt_image() to render the images by passing "case3" as the first argument and specifying either img_local_paths or img_url_paths as the path= argument:

    -
    +
    # equivalent to `Case 1`
    @@ -2054,52 +2054,52 @@ background-color: null;
     font-style: inherit;">"case3")
     )
    -
    +
    @@ -2152,7 +2152,7 @@ font-style: inherit;">"case3")

    Case 4: Image Names Using Both the path= and file_pattern= Arguments

    Case 4 demonstrates how to use path= and file_pattern= to specify images with names following a common pattern. For example, you could use file_pattern="metro_{}.svg" to reference images like metro_1.svg, metro_2.svg, and so on.

    Below is a Pandas DataFrame called metro_mini4, where the case4 column contains a copy of data["lines"], which we aim to render as images.

    -
    +
    Show the Code
    metro_mini4 "lines"]})
     

    First, define a string pattern to illustrate the file naming convention, using {} to indicate the variable portion:

    -
    +
    file_pattern = .svg"

    Next, pass "case4" as the first argument, along with img_local_paths or img_url_paths as the path= argument, and file_pattern as the file_pattern= argument. This allows GT.fmt_image() to render the images:

    -
    +
    # equivalent to `Case 1`
    @@ -2274,52 +2274,52 @@ background-color: null;
     font-style: inherit;">"case4")
     )
    -
    +
    @@ -2379,7 +2379,7 @@ Using file_pattern= Independently

    The file_pattern= argument is typically used in conjunction with the path= argument, but this is not a strict rule. If your local file paths or HTTP/HTTPS URLs follow a pattern, you can use file_pattern= alone without path=. This allows you to include the shared portion of the file paths or URLs directly in file_pattern, as shown below:

    -
    +
    file_pattern = "case4")
     )
    -
    +
    @@ -2516,7 +2516,7 @@ font-style: inherit;">"case4")

    Preparations

    We will create a Pandas DataFrame named metro_mini using the data dictionary. This will be used for demonstration in the following examples:

    -
    +
    Show the Code
    metro_mini = pd.DataFrame(data)
     

    Single Image

    This example shows how to render a valid URL as an image in the title of the table header:

    -
    +
    gt_logo_url = "gray")
     
     
    -
    +
    @@ -2729,7 +2729,7 @@ font-style: inherit;">"gray")

    Multiple Images

    This example demonstrates how to render two valid URLs as images in the title and subtitle of the table header:

    -
    +
    metro_logo_url = "gray")
     
     
    -
    +
    @@ -2895,7 +2895,7 @@ font-style: inherit;">"gray")

    Manually Rendering Images Anywhere

    Remember, you can always use html() to manually construct your desired output. For example, the previous table can be created without relying on vals.fmt_image() like this:

    -
    +
    (
         GT(metro_mini)
         .fmt_image(
     

    Generating a LaTeX table with Great Tables

    We can use the GT.as_latex() method to generate LaTeX table code. This code includes important structural pieces like titles, spanners, and value formatting. For example, here’s a simple table output as LaTeX code:

    -
    +
    Show the Code
    ```

    Current limitations of LaTeX table output

    The as_latex() method is still experimental and has some limitations. The following table lists the work epics that have been done and those planned:

    -
    +
    -
    +
    @@ -3667,7 +3667,7 @@ font-style: inherit;">```

    Starting things off with a big GT table

    The table we’ll make uses the nuclides dataset (available in the great_tables.data module). Through use of the tab_*() methods, quite a few table components (hence locations) will be added. We have hidden the code here because it is quite lengthy but you’re encouraged to check it out to glean some interesting GT tricks.

    -
    +
    Show the code
    2)
     gt_tbl
    -
    +
    @@ -4133,7 +4133,7 @@ font-style: inherit;">2)
  • Make the values in the atomic_mass and half_life use a monospace font.
  • fill the background of isotopes with STABLE half lives to be PaleTurquoise.
  • -
    +
    gt_tbl = (
    @@ -4186,54 +4186,54 @@ font-style: inherit;">"half_life").is_not_null())
     
     gt_tbl
    -
    +
    @@ -4416,7 +4416,7 @@ font-style: inherit;">"half_life").is_not_null())
  • Change the fill color (to ‘Linen’) and make the text bold for the entire stub
  • Highlight the rows where we have stable isotopes (the extent is both for the stub and the body cells)
  • -
    +
    gt_tbl = (
    @@ -4464,54 +4464,54 @@ font-style: inherit;">"half_life").is_null())
     
     gt_tbl
    -
    +
    @@ -4688,7 +4688,7 @@ font-style: inherit;">"half_life").is_null())

    Using custom style rules with the new style.css()

    Aside from decking out the loc module with all manner of location methods, we’ve added a little something to the style module: style.css()! What’s it for? It lets you supply style declarations to its single rule= argument.

    As an example, I might want to indent some text in one or more table cells. You can’t really do that with the style.text() method since it doesn’t have an indent= argument. So, in Great Tables 0.13.0 you can manually indent the row label text for the ‘STABLE’ rows using a CSS style rule:

    -
    +
    gt_tbl = (
    @@ -4713,54 +4713,54 @@ font-style: inherit;">"half_life").is_null())
     
     gt_tbl
    -
    +
    @@ -4935,7 +4935,7 @@ font-style: inherit;">"half_life").is_null())

    The combined location helpers: loc.column_header() and loc.footer()

    Look, I know we brought up the expression fine-grained before—right in the first paragraph—but sometimes you need just the opposite. There are lots of little locations in a GT table and some make for logical groupings. To that end, we have the concept of combined location helpers.

    Let’s set a grey background fill on the stubhead, column header, and footer:

    -
    +
    gt_tbl = (
    @@ -4960,54 +4960,54 @@ font-style: inherit;">=[loc.stubhead(), loc.column_header(), loc.footer()
     
     gt_tbl
    -
    +
    @@ -5182,7 +5182,7 @@ font-style: inherit;">=[loc.stubhead(), loc.column_header(), loc.footer()

    Styling the title and the subtitle

    Although it really doesn’t appear to have separate locations, the table header (produced by way of tab_header()) can have two of them: the title and the subtitle (the latter is optional). These can be targeted via loc.title() and loc.subtitle(). Let’s focus in on the title location and set an aliceblue background fill on the title, along with some font and border adjustments.

    -
    +
    gt_tbl = (
    @@ -5223,54 +5223,54 @@ font-style: inherit;">=loc.title()
     
     gt_tbl
    -
    +
    @@ -5441,7 +5441,7 @@ font-style: inherit;">=loc.title()

    Looks good. Notice that the title location is separate from the subtitle one, the background fill reveals the extent of its area.

    A subtitle is an optional part of the header. We do have one in our table example, so let’s style that as well. The style.css() method will be used to give the subtitle text some additional top and bottom padding, and, we’ll put in a fancy background involving a linear gradient.

    -
    +
    gt_tbl = (
    @@ -5469,54 +5469,54 @@ font-style: inherit;">=loc.subtitle()
     
     gt_tbl
    -
    +
    @@ -5687,7 +5687,7 @@ font-style: inherit;">=loc.subtitle()

    None of what was done above could be done prior to v0.13.0. The style.css() method makes this all possible.

    The combined location helper for the title and the subtitle locations is loc.header(). As mentioned before, it can be used as a shorthand for locations=[loc.title(), loc_subtitle()] and it’s useful here where we want to change the font for the title and subtitle text.

    -
    +
    gt_tbl = (
    @@ -5708,55 +5708,55 @@ font-style: inherit;">=loc.header()
     
     gt_tbl
    -
    +
    @@ -5930,7 +5930,7 @@ font-style: inherit;">=loc.header()

    How tab_style() fits in with tab_options()

    When it comes to styling, you can use tab_options() for some of the basics and use tab_style() for the more demanding styling tasks. And you could combine the usage of both in your table. Let’s set a default honeydew background fill on the body values:

    -
    +
    gt_tbl = gt_tbl.tab_options(table_background_color"HoneyDew")
     
     gt_tbl
    -
    +
    @@ -6195,7 +6195,7 @@ font-style: inherit;">"HoneyDew")
  • invoke google_font() within tab_style(styles=style.text(font=...)) to set the font within a location
  • Let’s start with this small table that uses the default set of fonts for the entire table.

    -
    +
    Show the code
    "This dataset is included in Great Tables."
     gt_tbl
    -
    +
    @@ -6368,7 +6368,7 @@ font-style: inherit;">"This dataset is included in Great Tables."

    Now, with opt_table_font() + google_font(), we’ll change the table’s font to one from Google Fonts. I like Noto Serif so let’s use that here!

    -
    +
    from great_tables "Noto Serif"))
     )
    -
    +
    @@ -6504,7 +6504,7 @@ font-style: inherit;">"Noto Serif"))

    Looking good! And we don’t have to apply the font to the entire table. We might just wanted to use a Google Font in the table body. For that use case, tab_style() is the preferred method. Here’s an example that uses the IBM Plex Mono typeface.

    -
    +
    (
         gt_tbl
         .tab_style(
    @@ -6523,53 +6523,53 @@ font-style: inherit;">=loc.body()
         )
     )
    -
    +
    @@ -6650,55 +6650,55 @@ font-style: inherit;">=loc.body()
  • using some combination of three row_striping_* arguments in tab_options()
  • Let’s use that example table with opt_row_striping().

    -
    +
    gt_tbl.opt_row_striping()
    -
    +
    @@ -6777,7 +6777,7 @@ font-style: inherit;">=loc.body()
  • row_striping_include_table_body: should striping include cells in the body?
  • With these new options, we can choose to stripe the entire row (stub cells + body cells) and use a darker color like "lightblue".

    -
    +
    (
         gt_tbl
         .tab_options(
    @@ -6799,52 +6799,52 @@ font-style: inherit;">True,
         )
     )
    -
    +
    @@ -6969,7 +6969,7 @@ Tip
  • formatting for very small numbers in scientific notation.
  • Great Tables provides the necessary functionality for all three requirements. Here is a summary table that tabulates rate constants for mercaptan compounds undergoing reaction with OH, O3, and Cl:

    -
    +
    Show the Code
    "humanist")
     )
    -
    +
    @@ -7302,7 +7302,7 @@ font-style: inherit;">"humanist")

    We added the nanoplots feature to Great Tables in v0.4.0 (check out the intro blog post for a quick explainer) so that tables can contain small, info-packed plots that fit reasonably well into a table context. They are interactive in that hovering over the data points provides additional plot information. This approach brings together the advantages of plots (elucidation of trends in data) and tables (access to numerical values representing the data points) in a single summary visualization.

    Version 0.10.0 of Great Tables adds the gibraltar dataset, which provides meteorological data (temeperature, humidity, wind speed, etc.) for the entire month of May 2024 at Gibraltar Airport Station.

    Nanoplots, as mentioned, are great for condensing a lot of information into a small area. Our example here with the gibraltar dataset takes all of the temperature and humidity data for the first 10 days of May 2023 and displays them in easy-to-explore nanoplots across two columns:

    -
    +
    Show the Code
    "humidity"]
     )
    -
    +
    @@ -8240,7 +8240,7 @@ $14.8M

    The challenge of removing hard dependencies

    Removing hard dependencies on DataFrame libraries is worthwhile, but requires special handling for all DataFrame specific actions. To illustrate consider the Great Tables output below, which is produced from a Pandas DataFrame:

    -
    +
    import pandas = pl.from_pandas(df_pandas)
     
     GT(df_pandas)
    -
    +
    @@ -8361,7 +8361,7 @@ font-style: inherit;">= pl.from_pandas(df_pandas)

    Getting column names

    The code below shows the different methods required to get column names as a list from Pandas and Polars.

    -
    +
    df_pandas.columns.tolist()  # pandas
    @@ -8373,7 +8373,7 @@ font-style: inherit;"># polars

    Notice that the two lines of code aren’t too different—Pandas just requires an extra .tolist() piece. We could create a special function, that returns a list of names, depending on the type of the input DataFrame.

    -
    +
    ")

    Inverting dependency with databackend

    Inverting dependency on DataFrame libraries means that we check whether something is a specific type of DataFrame, without using imports. This is done through the package databackend, which we copied into Great Tables.

    It works by creating placeholder classes, which stand in for the DataFrames they’re detecting:

    -
    +
    from great_tables._databackend "I'm a pandas DataFrame!!!")
    Separating concerns with singledispatch

    While databackend removes dependencies, the use of singledispatch from the built-in functools module separates out the logic for handling Polars DataFrames from the logic for Pandas DataFrames. This makes it easier to think one DataFrame at a time, and also gets us better type hinting.

    Here’s a basic example, showing the get_column_names() function re-written using singledispatch:

    -
    +
    from functools return data.columns
  • The use of PdDataFrame is what signifies “run this for Pandas DataFrames”.
  • With the get_column_names implementations defined, we can call it like a normal function:

    -
    +
    get_column_names(df_pandas)  # pandas version
    @@ -8648,54 +8648,54 @@ Tables made with computers (left to right): (1) a DataFrame printed at the conso
     
  • the data is primarily text
  • Let’s look at an example of a simple table with actual data to tie this theory to practice.

    -
    +
    -
    +
    @@ -8861,7 +8861,7 @@ A schematic with the complete set of table components that can be utilized in Table Footer: a place for additional information pertaining to the table content

    Here’s a table that takes advantage of the different components available in Great Tables. It contains the names and addresses of people.

    -
    +
    Show the code
    "14px",
     )
    -
    +
    @@ -9115,7 +9115,7 @@ A table of named individuals redone, Great Tables style!
  • a compact integer value (fmt_integer()): 134K
  • The problem grows worse when values need to be conveyed as images or plots. If you’re a medical analyst, for example, you might need to effectively convey whether test results for a patient are improving or worsening over time. Reading such data as a sequence of numbers across a row can slow interpretation. But by using nanoplots, available as the fmt_nanoplot() formatting method, readers can spot trends right away. Here’s an example that provides test results over a series of days.

    -
    +
    Show the code
    "Measurements from Day 3 through Day 9.")
     )
    -
    +
    @@ -9378,7 +9378,7 @@ font-style: inherit;">"Measurements from Day 3 through Day 9.")

    The recent v0.4.0 release of Great Tables contains nanoplots as a major new feature. So, in this post I’ll concentrate on showing you all the things you can do with nanoplots. What are nanoplots? Well, with nanoplots you can do this:

    -
    +
    Show the code
    "Measurements from Day 3 through to Day 8.")
     )
    -
    +
    @@ -9597,7 +9597,7 @@ font-style: inherit;">"Measurements from Day 3 through to Day 8.")

    Nanoplots, small interactive plots in your table

    Nanoplots are small yet information-laden plots that fit nicely into table cells. They are interactive, allowing for more information to be shown on hovering (or through touch when that interaction is available). Nanoplots try to show individual data points with reasonably good visibility (space is limited, this is going in a table after all!) and the plot representations change depending on the data fed into them.

    We can generate nanoplots via the fmt_nanoplot() method. Let’s make two nanoplots of the two different available plot types: "line" and "bar":

    -
    +
    random_numbers_df = pl.DataFrame(
    @@ -9660,52 +9660,52 @@ background-color: null;
     font-style: inherit;">"bar")
     )
    -
    +
    @@ -9752,7 +9752,7 @@ font-style: inherit;">"bar")

    Adding reference lines and highlighted areas

    It’s possible to add in a reference line and a reference area to individual plots. These may be useful to highlight a particular statistic (e.g., median or minimum value) or a bounded region of interest (e.g., the area between the first and third quartiles). Here is an example of how to use these options via the reference_line= and reference_area= arguments:

    -
    +
    (
         GT(random_numbers_df, rowname_col"median"])
     )
    -
    +
    @@ -9895,7 +9895,7 @@ font-style: inherit;">"median"])

    Simple bars

    We can also have single-value bar plots and line plots. These will run in the horizontal direction and such plots are meant for easy value comparisons (which works great in tables). To make this work, give fmt_nanoplot() a column of numeric values. The following example shows how fmt_nanoplot() can be used to create single-value bar and line plots.

    -
    +
    single_vals_df = pl.DataFrame(
    @@ -9968,52 +9968,52 @@ background-color: null;
     font-style: inherit;">"line")
     )
    -
    +
    @@ -10065,7 +10065,7 @@ font-style: inherit;">"line")

    Customizing with nanoplot_options()

    We provide a lot of options for customizing your nanoplots. With the nanoplot_options() helper function, it’s possible to change the look and feel for a set of nanoplots. The options= argument of fmt_nanoplot() is where you’d need to invoke that helper function. Some possibilities for customization include determining which nanoplot elements are present, changing the sizes and colors of different elements, and a whole lot more! Here’s an example where both line- and bar-based nanoplots retain their basic compositional elements, but their appearance is quite different.

    -
    +
    from great_tables "blue",
         )
     )
    -
    +
    @@ -10282,7 +10282,7 @@ font-style: inherit;">"blue",

    Modifying the widths of columns

    Before v0.3.0, you could not alter the widths of individual columns. This meant that to great extent your content decided the width of individual columns. Even though browsers do an adequate job in sizing the widths of table columns, it doesn’t always result in a pleasing-to-look-at table. What if you want more space? Maybe you want consistently-sized columns? There’s many reasons to want to have a choice in the matter and the new cols_width() method now makes this possible.

    Here’s an example where the widths of all columns are set with our preferred length values (in px).

    -
    +
    from great_tables "50px"
         )
     )
    -
    +
    @@ -10457,7 +10457,7 @@ font-style: inherit;">"50px"

    Setting options across the entire table with tab_options()

    The new tab_options() method gives you the freedom to specify any of dozens of global style and layout options for the table. Want a font that’s used across all cells? Use the table_font_names= option. Do you need to make the text smaller, but only in the stub? Use stub_font_size= for that. The number of options is perhaps overwhelming at first but we think you’ll enjoy having them around nonetheless. It makes styling the table (and developing your own table themes) a relatively simple task.

    Here’s an example that creates a table with a few common components and then uses tab_options() to set up a collection of fonts for the table with the (also new) system_fonts() function:

    -
    +
    from great_tables ="industrial"))
    -
    +
    @@ -10663,59 +10663,59 @@ font-style: inherit;">"industrial"))

    Note that table_font_names= accepts a list of fonts that operate as fallbacks for users across different systems (i.e., they may not have the font you have). And the system_fonts() helper function in Great Tables makes this easy by providing you with themed, local font stacks that are meant to work across different computing platforms.

    Here’s another example where we set the width of the table to span across the entire page (or containing element).

    -
    +
    gt_tbl.tab_options(table_width="100%")
    -
    +
    @@ -10805,59 +10805,59 @@ font-style: inherit;">"100%")

    One more where the background color of the table is set to "lightcyan":

    -
    +
    gt_tbl.tab_options(table_background_color="lightcyan")
    -
    +
    @@ -10951,59 +10951,59 @@ font-style: inherit;">"lightcyan")

    Using the new opt_*() methods to do more complex tasks with table options

    While tab_options() is a great method for setting global table options, sometimes you want to set a number of them at once for a combined effect. For that type of operation, we have the opt_*() series of methods. A common thing you might do is align the content in the table header, we can make that an easy thing with opt_align_table_header():

    -
    +
    gt_tbl.opt_align_table_header(align="left")
    -
    +
    @@ -11094,55 +11094,55 @@ font-style: inherit;">"left")

    With that, you don’t have to hunt through the myriad options within tab_options() to find the two args you need to get the job done.

    The opt_all_caps() method transforms the text within the column labels, the stub, and in all row groups so that we get an all-capitalized (yet somewhat sized down) look that better differentiates the labels from the data. It’s rather easy to use, just do this:

    -
    +
    gt_tbl.opt_all_caps()
    -
    +
    @@ -11233,59 +11233,59 @@ font-style: inherit;">"left")

    This sets nine options you’d otherwise set in tab_options() all at once, making life generally easier.

    Here’s one last example, this time using opt_vertical_padding(). You’d use that if you’re dissatisfied with the level of top/bottom padding within cells of all locations (e.g., in the table body, in the column labels, etc.). You can either make a table taller or more ‘compressed’ with a single argument: scale=. Here’s an example where the amount of vertical padding is reduced, resulting in a table taking up less vertical space.

    -
    +
    gt_tbl.opt_vertical_padding(scale=0.5)
    -
    +
    @@ -11387,7 +11387,7 @@ font-style: inherit;">0.5)

    A new formatting method: fmt_image()

    Wouldn’t it be great to add graphics to your table? The fmt_image() method provides an easy way to add image files on disk into table body cells. The cells need to contain some reference to an image file. The path= and file_pattern= arguments give you some flexibility in defining exactly where the image files live.

    Here’s an example using the metro dataset that’s included within Great Tables.

    -
    +
    from great_tables.data "700px")
     )
    -
    +
    @@ -11599,7 +11599,7 @@ font-style: inherit;">"700px")
  • Away team digit: 7
  • Let’s say you choose the digits above, and write this as 4/7—meaning a final digit of 4 for home and 7 for away. You would mark yourself on this square:

    -
    +
    Code
    df "Away")
     )
    -
    +
    @@ -11940,7 +11940,7 @@ font-style: inherit;">"Away")

    What squares are most likely to win?

    We looked back at games for the KC Chiefs (away), and games for the San Francisco 49ers (home), and calculated the proportion of the time each team ended with a specific digit. Putting this together for the two teams, here is the chance of winning on a given square:

    -
    +
    Code
    '<span style="float: right;">Source data: [Lee Sharp
     )
    -
    +
    @@ -12471,7 +12471,7 @@ Appendix: analysis and code

    Code

    -
    +
    import polars '<span style="float: right;">Source data: [Lee Sharp
         )
     )
    -
    +
    @@ -12984,7 +12984,7 @@ font-style: inherit;">'<span style="float: right;">Source data: [Lee Sharp

    We enjoy working on Great Tables because we want everybody to easily make beautiful tables. Tables don’t have to be boring, they really could be captivating and insightful. With every release we get closer and closer to realizing our mission and, as such, we’re happy to announce the v0.2.0 release that’s now on PyPI.

    The really big feature that’s available with this release is the data_color() method. It gives you several options for colorizing data cells based on the underlying data. The method automatically scales color values according to the data in order to emphasize differences or reveal trends. The example below emphasizes large currency values with a "darkgreen" fill color.

    -
    +
    from great_tables "darkgreen"]
         )
     )
    -
    +
    @@ -13110,7 +13110,7 @@ font-style: inherit;">"darkgreen"]

    Note that we use columns= to specify which columns get the colorizing treatment (just currency here) and the palette= is given as a list of color values. From this we can see that the 65100.0 value polarizes the data coloring process; it is "darkgreen" while all other values are "lightblue" (with no interpolated colors in between). Also, isn’t it nice that the text adapts to the background color?

    The above example is suitable for emphasizing large values, but, maybe you consider the extreme value to be something that’s out of bounds? For that, we can use the domain= and na_value= arguments to gray-out the extreme values. We’ll also nicely format the currency column in this next example.

    -
    +
    (
         GT(exibble[[False
         )
     )
    -
    +
    @@ -13259,7 +13259,7 @@ font-style: inherit;">False

    Now the very large value is in "lightgray", making all other values easier to compare. We did setting domain=[0, 50] and specifying na_color="lightgray". This caused the out-of-bounds value of 65100 to have a light gray background. Notice that the values are also formatted as currencies, and this is thanks to fmt_currency() which never interferes with styling.

    Here’s a more inspirational example that uses a heavily-manipulated version of the countrypops dataset (thanks again, Polars!) along with a color treatment that’s mediated by data_color(). Here, the population values can be easily compared by the amount of "purple" within them.

    -
    +
    from great_tables.data 1.7e5])
     )
    -
    +
    @@ -13533,7 +13533,7 @@ font-style: inherit;">1.7e5])

    However, there are fewer options for styling tables for presentation. You could convert from polars to pandas, and use the built-in pandas DataFrame styler, but this has one major limitation: you can’t use polars expressions.

    As it turns out, polars expressions make styling tables very straightforward. The same polars code that you would use to select or filter combines with Great Tables to highlight, circle, or bolden text.

    In this post, I’ll show how Great Tables uses polars expressions to make delightful tables, like the one below.

    -
    +
    Code
    max())
     )
    -
    +
    @@ -13910,7 +13910,7 @@ font-style: inherit;">max())

    Creating GT object

    First, we’ll import the necessary libraries, and do a tiny bit of data processing.

    -
    +
    import polars "Temp"
     

    The default polars output above is really helpful for data analysis! By passing it to the GT constructor, we can start getting it ready for presentation.

    -
    +
    gt_air = GT(pl_airquality)
     
     gt_air
    -
    +
    @@ -14106,7 +14106,7 @@ font-style: inherit;">= GT(pl_airquality)

    Set title and subtitle

    The simplest method in gt is GT.tab_header(), which lets you add a title and subtitle.

    -
    +
    (
         gt_air
     
    @@ -14127,52 +14127,52 @@ font-style: inherit;">"Daily measurements in New York City (May 1-10, 1973)"    )
     )
    -
    +
    @@ -14254,7 +14254,7 @@ font-style: inherit;">"Daily measurements in New York City (May 1-10, 1973)"

    Set body styles

    The .tab_style() method sets styles—like fill color, or text properties—on different parts of the table. Let’s use it twice with a polars expression. First to highlight the row corresponding to the max Wind value, and then to bold that value.

    -
    +
    from great_tables "Wind", is_max_wind)
         )
     )
    -
    +
    @@ -14438,7 +14438,7 @@ font-style: inherit;">"Wind", is_max_wind)
  • More readable labels for columns themselves.
  • Use GT.tab_spanner() to set labels on groups of columns.

    -
    +
    time_cols = [=cs.exclude(time_cols)
     
     gt_with_spanners
    -
    +
    @@ -14607,7 +14607,7 @@ font-style: inherit;">=cs.exclude(time_cols)

    Notice that there are now labels for “Time” and “Measurement” sitting above the column names. This is useful for emphasizing columns that share something in common.

    Use GT.cols_labels() with html() to create human-friendly labels (e.g. convert things like cal_m_2 to cal/m2).

    -
    +
    from great_tables "Temp,<br>&deg;F")
         )
     )
    -
    +
    @@ -14770,7 +14770,7 @@ font-style: inherit;">"Temp,<br>&deg;F")

    Putting it all together

    Finally, we’ll combine everything from the sections above into a single block of code, and use a few more rows of data.

    -
    +
    Code
    max())
     )
    -
    +
    @@ -15164,7 +15164,7 @@ font-style: inherit;">pip install great_tables

    A Basic Table

    Let’s get right to making a display table with Great Tables. The package has quite a few datasets and so we’ll start by making use of the very small, but useful, exibble dataset. After importing the GT class and that dataset, we’ll introduce that Pandas table to GT().

    -
    +
    from great_tables # Now, show the gt table
     gt_tbl
    -
    +
    @@ -15350,7 +15350,7 @@ font-style: inherit;"># Now, show the gt table

    More Complex Tables

    Let’s take things a bit further and create a table with the included gtcars dataset. Great Tables provides a large selection of methods and they let you refine the table display. They were designed so that you can easily create a really presentable and beautiful table visualization.

    For this next table, we’ll incorporate a Stub component and this provides a place for the row labels. Groupings of rows will be generated through categorical values in a particular column (we just have to cite the column name for that to work). We’ll add a table title and subtitle with tab_header(). The numerical values will be formatted with the fmt_integer() and fmt_currency() methods. Column labels will be enhanced via cols_label() and a source note will be included through use of the tab_source_note() method. Here is the table code, followed by the table itself.

    -
    +
    from great_tables "Source: the gtcars dataset within the Great Tables package.")
     )
    -
    +
    @@ -15628,7 +15628,7 @@ font-style: inherit;">"Source: the gtcars dataset within the Great Tables packag

    With the six different methods applied, the table looks highly presentable! The rendering you’re seeing here has been done through Quarto (this entire site has been generated with quartodoc). If you haven’t yet tried out Quarto, we highly recommend it!

    For this next example we’ll use the airquality dataset (also included in the package; it’s inside the data submodule). With this table, two spanners will be added with the tab_spanner() method. This method is meant to be easy to use, you only need to provide the text for the spanner label and the columns associated with the spanner. We also make it easy to move columns around. You can use cols_move_to_start() (example of that below) and there are also the cols_move_to_end() and cols_move() methods.

    -
    +
    from great_tables.data "Day"])
     )
    -
    +
    @@ -15915,7 +15915,7 @@ font-style: inherit;">"Day"])
  • fmt(): set a column format with a formatting function
  • We strive to make formatting a simple task but we also want to provide the user a lot of power through advanced options and we ensure that varied combinations of options works well. For example, most of the formatting methods have a locale= argument. We want as many users as possible to be able to format numbers, dates, and times in ways that are familiar to them and are adapted to their own regional specifications. Now let’s take a look at an example of this with a smaller version of the exibble dataset:

    -
    +
    exibble_smaller = exibble[["h_m_s_p")
     )
    -
    +
    @@ -16054,7 +16054,7 @@ font-style: inherit;">"h_m_s_p")

    Using Styles within a Table

    We can use the tab_style() method in combination with loc.body() and various style.*() functions to set styles on cells of data within the table body. For example, the table-making code below applies a yellow background color to the targeted cells.

    -
    +
    from great_tables 2])
         )
     )
    -
    +
    @@ -16207,7 +16207,7 @@ font-style: inherit;">2])

    Aside from style.fill() we can also use style.text() and style.borders() to focus the styling on cell text and borders. Here’s an example where we perform several types of styling on targeted cells (the key is to put the style.*() calls in a list).

    -
    +
    from great_tables "currency")
         )
     )
    -
    +
    @@ -16384,7 +16384,7 @@ font-style: inherit;">"currency")

    Column Selection with Polars (and How It Helps with Styling)

    Styles can also be specified using Polars expressions. For example, the code below uses the Temp column to set color to "lightyellow" or "lightblue".

    -
    +
    import polars "Temp")
         )
     )
    -
    +
    @@ -16557,7 +16557,7 @@ font-style: inherit;">"Temp")

    We can deftly mix and match Polars column selectors and expressions. This gives us great flexibility in selecting specific columns and rows. Here’s an example of doing that again with tab_style():

    -
    +
    import polars.selectors 70
         )
     )
    -
    +
    diff --git a/blog/introduction-0.12.0/index.html b/blog/introduction-0.12.0/index.html index 9f9dceaa2..4f74e6150 100644 --- a/blog/introduction-0.12.0/index.html +++ b/blog/introduction-0.12.0/index.html @@ -235,7 +235,7 @@

    Using fonts
  • invoke google_font() within tab_style(styles=style.text(font=...)) to set the font within a location
  • Let’s start with this small table that uses the default set of fonts for the entire table.

    -
    +
    Show the code
    from great_tables import GT, exibble, style, loc
    @@ -255,52 +255,52 @@ 

    Using fonts gt_tbl

    -
    +

    @@ -372,7 +372,7 @@

    Using fonts

    Now, with opt_table_font() + google_font(), we’ll change the table’s font to one from Google Fonts. I like Noto Serif so let’s use that here!

    -
    +
    from great_tables import GT, exibble, style, loc, google_font
     
     (
    @@ -380,53 +380,53 @@ 

    Using fonts .opt_table_font(font=google_font(name="Noto Serif")) )

    -
    +

    @@ -498,7 +498,7 @@

    Using fonts

    Looking good! And we don’t have to apply the font to the entire table. We might just wanted to use a Google Font in the table body. For that use case, tab_style() is the preferred method. Here’s an example that uses the IBM Plex Mono typeface.

    -
    +
    (
         gt_tbl
         .tab_style(
    @@ -507,53 +507,53 @@ 

    Using fonts ) )

    -
    +

    @@ -634,55 +634,55 @@

    Striping rows
  • using some combination of three row_striping_* arguments in tab_options()
  • Let’s use that example table with opt_row_striping().

    -
    +
    gt_tbl.opt_row_striping()
    -
    +

    @@ -761,7 +761,7 @@

    Striping rows
  • row_striping_include_table_body: should striping include cells in the body?
  • With these new options, we can choose to stripe the entire row (stub cells + body cells) and use a darker color like "lightblue".

    -
    +
    (
         gt_tbl
         .tab_options(
    @@ -771,52 +771,52 @@ 

    Striping rows ) )

    -
    +

    diff --git a/blog/introduction-0.13.0/index.html b/blog/introduction-0.13.0/index.html index fbfc2702e..2bb16ee42 100644 --- a/blog/introduction-0.13.0/index.html +++ b/blog/introduction-0.13.0/index.html @@ -238,7 +238,7 @@

    Great Tables v0.13.0: Applying styles to all tabl

    Starting things off with a big GT table

    The table we’ll make uses the nuclides dataset (available in the great_tables.data module). Through use of the tab_*() methods, quite a few table components (hence locations) will be added. We have hidden the code here because it is quite lengthy but you’re encouraged to check it out to glean some interesting GT tricks.

    -
    +
    Show the code
    from great_tables import GT, md, style, loc, google_font
    @@ -292,53 +292,53 @@ 

    St gt_tbl

    -
    +

    @@ -524,7 +524,7 @@

    Styling the body

  • Make the values in the atomic_mass and half_life use a monospace font.
  • fill the background of isotopes with STABLE half lives to be PaleTurquoise.
  • -
    +
    gt_tbl = (
         gt_tbl
         .tab_style(
    @@ -539,54 +539,54 @@ 

    Styling the body

    gt_tbl
    -
    +
    @@ -769,7 +769,7 @@

    Don’t forget the st
  • Change the fill color (to ‘Linen’) and make the text bold for the entire stub
  • Highlight the rows where we have stable isotopes (the extent is both for the stub and the body cells)
  • -
    +
    gt_tbl = (
         gt_tbl
         .tab_style(
    @@ -787,54 +787,54 @@ 

    Don’t forget the st gt_tbl

    -
    +

    @@ -1011,7 +1011,7 @@

    Don’t forget the st

    Using custom style rules with the new style.css()

    Aside from decking out the loc module with all manner of location methods, we’ve added a little something to the style module: style.css()! What’s it for? It lets you supply style declarations to its single rule= argument.

    As an example, I might want to indent some text in one or more table cells. You can’t really do that with the style.text() method since it doesn’t have an indent= argument. So, in Great Tables 0.13.0 you can manually indent the row label text for the ‘STABLE’ rows using a CSS style rule:

    -
    +
    gt_tbl = (
         gt_tbl
         .tab_style(
    @@ -1022,54 +1022,54 @@ 

    gt_tbl

    -
    +
    @@ -1244,7 +1244,7 @@

    The combined location helpers: loc.column_header() and loc.footer()

    Look, I know we brought up the expression fine-grained before—right in the first paragraph—but sometimes you need just the opposite. There are lots of little locations in a GT table and some make for logical groupings. To that end, we have the concept of combined location helpers.

    Let’s set a grey background fill on the stubhead, column header, and footer:

    -
    +
    gt_tbl = (
         gt_tbl
         .tab_style(
    @@ -1255,54 +1255,54 @@ 

    gt_tbl

    -
    +
    @@ -1477,7 +1477,7 @@

    Styling the title and the subtitle

    Although it really doesn’t appear to have separate locations, the table header (produced by way of tab_header()) can have two of them: the title and the subtitle (the latter is optional). These can be targeted via loc.title() and loc.subtitle(). Let’s focus in on the title location and set an aliceblue background fill on the title, along with some font and border adjustments.

    -
    +
    gt_tbl = (
         gt_tbl
         .tab_style(
    @@ -1492,54 +1492,54 @@ 

    Styling gt_tbl

    -
    +
    @@ -1710,7 +1710,7 @@

    Styling

    Looks good. Notice that the title location is separate from the subtitle one, the background fill reveals the extent of its area.

    A subtitle is an optional part of the header. We do have one in our table example, so let’s style that as well. The style.css() method will be used to give the subtitle text some additional top and bottom padding, and, we’ll put in a fancy background involving a linear gradient.

    -
    +
    gt_tbl = (
         gt_tbl
         .tab_style(
    @@ -1724,54 +1724,54 @@ 

    Styling gt_tbl

    -
    +

    @@ -1942,7 +1942,7 @@

    Styling

    None of what was done above could be done prior to v0.13.0. The style.css() method makes this all possible.

    The combined location helper for the title and the subtitle locations is loc.header(). As mentioned before, it can be used as a shorthand for locations=[loc.title(), loc_subtitle()] and it’s useful here where we want to change the font for the title and subtitle text.

    -
    +
    gt_tbl = (
         gt_tbl
         .tab_style(
    @@ -1953,55 +1953,55 @@ 

    Styling gt_tbl

    -
    +

    @@ -2175,60 +2175,60 @@

    Styling

    How tab_style() fits in with tab_options()

    When it comes to styling, you can use tab_options() for some of the basics and use tab_style() for the more demanding styling tasks. And you could combine the usage of both in your table. Let’s set a default honeydew background fill on the body values:

    -
    +
    gt_tbl = gt_tbl.tab_options(table_background_color="HoneyDew")
     
     gt_tbl
    -
    +

    diff --git a/blog/introduction-0.15.0/index.html b/blog/introduction-0.15.0/index.html index 90103b64c..37f9b74be 100644 --- a/blog/introduction-0.15.0/index.html +++ b/blog/introduction-0.15.0/index.html @@ -233,7 +233,7 @@

    Great Tables v0.15.0: Flags, Icons, and Other For

    Using fmt_flag() to incorporate country flag icons

    When tables contain country-level data, having a more visual representation for a country can help the reader more quickly parse the table contents. The new fmt_flag() method makes this easy to accomplish. You just need to have either two-letter country codes or three-letter country codes in a column.

    Here’s an example where country flags, shown as simplified circular icons, can be added to a table with fmt_flag():

    -
    +
    from great_tables import GT
     from great_tables.data import peeps
     import polars as pl
    @@ -261,52 +261,52 @@ 

    ) )

    -
    +
    @@ -368,7 +368,7 @@

    , "SVN", and "CAN") within the country column. So long as they are correct, fmt_flag() will perform the conversion to flag icons. Also, there’s a little bit of interactivity here: when hovering over a flag, the country name will appear as a tooltip!

    We have the power to display multiple flag icons within a single cell. To make this happen, the country codes need to be combined in a single string where each code is separated by a comma (e.g., "US,DE,GB"). Here’s an example that uses a portion of the films dataset:

    -
    +
    from great_tables import GT, google_font
     from great_tables.data import films
     import polars as pl
    @@ -389,53 +389,53 @@ 

    .opt_table_font(font=google_font("PT Sans")) )

    -
    +

    @@ -496,7 +496,7 @@

    Using fmt_icon() to include Font Awesome icons

    The new fmt_icon() method gives you the ability to easily include FontAwesome icons in a table. It uses a similar input/output scheme as with fmt_flag(): provide the short icon name (e.g., "table", "music", "globe", etc.) or a comma-separated list of them, and fmt_icon() will provide the Font Awesome icon in place. Let’s see it in action with an example that uses the metro dataset:

    -
    +
    from great_tables import GT
     from great_tables.data import metro
     import polars as pl
    @@ -523,52 +523,52 @@ 

    .opt_align_table_header(align="left") )

    -
    +
    @@ -652,7 +652,7 @@

    +
    Show the code
    from great_tables import GT
    @@ -693,52 +693,52 @@ 

    )

    -
    +

    diff --git a/blog/introduction-0.2.0/index.html b/blog/introduction-0.2.0/index.html index f05703c8b..0bf5836b0 100644 --- a/blog/introduction-0.2.0/index.html +++ b/blog/introduction-0.2.0/index.html @@ -215,7 +215,7 @@

    Great Tables v0.2.0: Easy Data Coloring

    We enjoy working on Great Tables because we want everybody to easily make beautiful tables. Tables don’t have to be boring, they really could be captivating and insightful. With every release we get closer and closer to realizing our mission and, as such, we’re happy to announce the v0.2.0 release that’s now on PyPI.

    The really big feature that’s available with this release is the data_color() method. It gives you several options for colorizing data cells based on the underlying data. The method automatically scales color values according to the data in order to emphasize differences or reveal trends. The example below emphasizes large currency values with a "darkgreen" fill color.

    -
    +
    from great_tables import GT, exibble
     
     (
    @@ -226,52 +226,52 @@ 

    Great Tables v0.2.0: Easy Data Coloring

    ) )
    -
    +
    @@ -315,7 +315,7 @@

    Great Tables v0.2.0: Easy Data Coloring

    Note that we use columns= to specify which columns get the colorizing treatment (just currency here) and the palette= is given as a list of color values. From this we can see that the 65100.0 value polarizes the data coloring process; it is "darkgreen" while all other values are "lightblue" (with no interpolated colors in between). Also, isn’t it nice that the text adapts to the background color?

    The above example is suitable for emphasizing large values, but, maybe you consider the extreme value to be something that’s out of bounds? For that, we can use the domain= and na_value= arguments to gray-out the extreme values. We’ll also nicely format the currency column in this next example.

    -
    +
    (
         GT(exibble[["currency", "date", "row"]].head(4), rowname_col="row")
         .data_color(
    @@ -331,52 +331,52 @@ 

    Great Tables v0.2.0: Easy Data Coloring

    ) )
    -
    +
    @@ -420,7 +420,7 @@

    Great Tables v0.2.0: Easy Data Coloring

    Now the very large value is in "lightgray", making all other values easier to compare. We did setting domain=[0, 50] and specifying na_color="lightgray". This caused the out-of-bounds value of 65100 to have a light gray background. Notice that the values are also formatted as currencies, and this is thanks to fmt_currency() which never interferes with styling.

    Here’s a more inspirational example that uses a heavily-manipulated version of the countrypops dataset (thanks again, Polars!) along with a color treatment that’s mediated by data_color(). Here, the population values can be easily compared by the amount of "purple" within them.

    -
    +
    from great_tables.data import countrypops
     import polars as pl
     import polars.selectors as cs
    @@ -446,52 +446,52 @@ 

    Great Tables v0.2.0: Easy Data Coloring

    .data_color(palette=["white", "purple"], domain=[0, 1.7e5]) )
    -
    +
    diff --git a/blog/introduction-0.3.0/index.html b/blog/introduction-0.3.0/index.html index 4a44f8b75..d779e7ffe 100644 --- a/blog/introduction-0.3.0/index.html +++ b/blog/introduction-0.3.0/index.html @@ -228,7 +228,7 @@

    Great Tables v0.3.0: So Many Style Options!

    Modifying the widths of columns

    Before v0.3.0, you could not alter the widths of individual columns. This meant that to great extent your content decided the width of individual columns. Even though browsers do an adequate job in sizing the widths of table columns, it doesn’t always result in a pleasing-to-look-at table. What if you want more space? Maybe you want consistently-sized columns? There’s many reasons to want to have a choice in the matter and the new cols_width() method now makes this possible.

    Here’s an example where the widths of all columns are set with our preferred length values (in px).

    -
    +
    from great_tables import GT, exibble
     
     exibble_mini = exibble[["num", "char", "date", "datetime", "row"]].head(5)
    @@ -245,52 +245,52 @@ 

    Modifying ) )

    -
    +
    @@ -363,7 +363,7 @@

    Modifying

    Setting options across the entire table with tab_options()

    The new tab_options() method gives you the freedom to specify any of dozens of global style and layout options for the table. Want a font that’s used across all cells? Use the table_font_names= option. Do you need to make the text smaller, but only in the stub? Use stub_font_size= for that. The number of options is perhaps overwhelming at first but we think you’ll enjoy having them around nonetheless. It makes styling the table (and developing your own table themes) a relatively simple task.

    Here’s an example that creates a table with a few common components and then uses tab_options() to set up a collection of fonts for the table with the (also new) system_fonts() function:

    -
    +
    from great_tables import md, system_fonts
     
     gt_tbl = (
    @@ -383,52 +383,52 @@ 

    gt_tbl.tab_options(table_font_names=system_fonts(name="industrial"))

    -
    +
    @@ -519,55 +519,55 @@

    system_fonts() helper function in Great Tables makes this easy by providing you with themed, local font stacks that are meant to work across different computing platforms.

    Here’s another example where we set the width of the table to span across the entire page (or containing element).

    -
    +
    gt_tbl.tab_options(table_width="100%")
    -
    +

    @@ -657,55 +657,55 @@

    :

    -
    +
    gt_tbl.tab_options(table_background_color="lightcyan")
    -
    +

    @@ -799,55 +799,55 @@

    Using the new opt_*() methods to do more complex tasks with table options

    While tab_options() is a great method for setting global table options, sometimes you want to set a number of them at once for a combined effect. For that type of operation, we have the opt_*() series of methods. A common thing you might do is align the content in the table header, we can make that an easy thing with opt_align_table_header():

    -
    +
    gt_tbl.opt_align_table_header(align="left")
    -
    +
    @@ -938,55 +938,55 @@

    tab_options() to find the two args you need to get the job done.

    The opt_all_caps() method transforms the text within the column labels, the stub, and in all row groups so that we get an all-capitalized (yet somewhat sized down) look that better differentiates the labels from the data. It’s rather easy to use, just do this:

    -
    +
    gt_tbl.opt_all_caps()
    -
    +

    @@ -1077,55 +1077,55 @@

    tab_options() all at once, making life generally easier.

    Here’s one last example, this time using opt_vertical_padding(). You’d use that if you’re dissatisfied with the level of top/bottom padding within cells of all locations (e.g., in the table body, in the column labels, etc.). You can either make a table taller or more ‘compressed’ with a single argument: scale=. Here’s an example where the amount of vertical padding is reduced, resulting in a table taking up less vertical space.

    -
    +
    gt_tbl.opt_vertical_padding(scale=0.5)
    -
    +

    @@ -1227,7 +1227,7 @@

    A new formatting method: fmt_image()

    Wouldn’t it be great to add graphics to your table? The fmt_image() method provides an easy way to add image files on disk into table body cells. The cells need to contain some reference to an image file. The path= and file_pattern= arguments give you some flexibility in defining exactly where the image files live.

    Here’s an example using the metro dataset that’s included within Great Tables.

    -
    +
    from great_tables.data import metro
     from importlib_resources import files
     
    @@ -1246,52 +1246,52 @@ 

    A new fo .tab_options(table_width="700px") )

    -
    +
    diff --git a/blog/introduction-0.4.0/index.html b/blog/introduction-0.4.0/index.html index 7c9cca1ad..bea8e9e44 100644 --- a/blog/introduction-0.4.0/index.html +++ b/blog/introduction-0.4.0/index.html @@ -224,7 +224,7 @@

    Great Tables v0.4.0: Nanoplots and More

    The recent v0.4.0 release of Great Tables contains nanoplots as a major new feature. So, in this post I’ll concentrate on showing you all the things you can do with nanoplots. What are nanoplots? Well, with nanoplots you can do this:

    -
    +
    Show the code
    from great_tables import GT, md
    @@ -251,52 +251,52 @@ 

    Great Tables v0.4.0: Nanoplots and More

    )
    -
    +
    @@ -375,7 +375,7 @@

    Great Tables v0.4.0: Nanoplots and More

    Nanoplots, small interactive plots in your table

    Nanoplots are small yet information-laden plots that fit nicely into table cells. They are interactive, allowing for more information to be shown on hovering (or through touch when that interaction is available). Nanoplots try to show individual data points with reasonably good visibility (space is limited, this is going in a table after all!) and the plot representations change depending on the data fed into them.

    We can generate nanoplots via the fmt_nanoplot() method. Let’s make two nanoplots of the two different available plot types: "line" and "bar":

    -
    +
    random_numbers_df = pl.DataFrame(
         {
             "i": range(1, 5),
    @@ -394,52 +394,52 @@ 

    .fmt_nanoplot(columns="bars", plot_type="bar") )

    -
    +
    @@ -486,7 +486,7 @@

    Adding reference lines and highlighted areas

    It’s possible to add in a reference line and a reference area to individual plots. These may be useful to highlight a particular statistic (e.g., median or minimum value) or a bounded region of interest (e.g., the area between the first and third quartiles). Here is an example of how to use these options via the reference_line= and reference_area= arguments:

    -
    +
    (
         GT(random_numbers_df, rowname_col="i")
         .fmt_nanoplot(
    @@ -501,52 +501,52 @@ 

    reference_area=["max", "median"]) )

    -
    +
    @@ -593,7 +593,7 @@

    Simple bars

    We can also have single-value bar plots and line plots. These will run in the horizontal direction and such plots are meant for easy value comparisons (which works great in tables). To make this work, give fmt_nanoplot() a column of numeric values. The following example shows how fmt_nanoplot() can be used to create single-value bar and line plots.

    -
    +
    single_vals_df = pl.DataFrame(
         {
             "i": range(1, 6),
    @@ -608,52 +608,52 @@ 

    Simple bars

    .fmt_nanoplot(columns="lines", plot_type="line") )
    -
    +
    @@ -705,7 +705,7 @@

    Simple bars

    Customizing with nanoplot_options()

    We provide a lot of options for customizing your nanoplots. With the nanoplot_options() helper function, it’s possible to change the look and feel for a set of nanoplots. The options= argument of fmt_nanoplot() is where you’d need to invoke that helper function. Some possibilities for customization include determining which nanoplot elements are present, changing the sizes and colors of different elements, and a whole lot more! Here’s an example where both line- and bar-based nanoplots retain their basic compositional elements, but their appearance is quite different.

    -
    +
    from great_tables import nanoplot_options
     
     (
    @@ -736,52 +736,52 @@ 

    Customiz ) )

    -
    +
    diff --git a/blog/introduction_great_tables.html b/blog/introduction_great_tables.html index a416af36a..cdf7ce825 100644 --- a/blog/introduction_great_tables.html +++ b/blog/introduction_great_tables.html @@ -238,7 +238,7 @@

    Introducing Great Tables

    A Basic Table

    Let’s get right to making a display table with Great Tables. The package has quite a few datasets and so we’ll start by making use of the very small, but useful, exibble dataset. After importing the GT class and that dataset, we’ll introduce that Pandas table to GT().

    -
    +
    from great_tables import GT, exibble
     
     # Create a display table with the `exibble` dataset
    @@ -247,52 +247,52 @@ 

    A Basic Table

    # Now, show the gt table gt_tbl
    -
    +
    @@ -414,7 +414,7 @@

    A Basic Table

    More Complex Tables

    Let’s take things a bit further and create a table with the included gtcars dataset. Great Tables provides a large selection of methods and they let you refine the table display. They were designed so that you can easily create a really presentable and beautiful table visualization.

    For this next table, we’ll incorporate a Stub component and this provides a place for the row labels. Groupings of rows will be generated through categorical values in a particular column (we just have to cite the column name for that to work). We’ll add a table title and subtitle with tab_header(). The numerical values will be formatted with the fmt_integer() and fmt_currency() methods. Column labels will be enhanced via cols_label() and a source note will be included through use of the tab_source_note() method. Here is the table code, followed by the table itself.

    -
    +
    from great_tables import GT, md, html
     from great_tables.data import gtcars
     
    @@ -433,52 +433,52 @@ 

    More Complex Tables .tab_source_note(source_note="Source: the gtcars dataset within the Great Tables package.") )

    -
    +
    @@ -606,7 +606,7 @@

    More Complex Tables

    With the six different methods applied, the table looks highly presentable! The rendering you’re seeing here has been done through Quarto (this entire site has been generated with quartodoc). If you haven’t yet tried out Quarto, we highly recommend it!

    For this next example we’ll use the airquality dataset (also included in the package; it’s inside the data submodule). With this table, two spanners will be added with the tab_spanner() method. This method is meant to be easy to use, you only need to provide the text for the spanner label and the columns associated with the spanner. We also make it easy to move columns around. You can use cols_move_to_start() (example of that below) and there are also the cols_move_to_end() and cols_move() methods.

    -
    +
    from great_tables.data import airquality
     
     airquality_mini = airquality.head(10).assign(Year=1973)
    @@ -628,52 +628,52 @@ 

    More Complex Tables .cols_move_to_start(columns=["Year", "Month", "Day"]) )

    -
    +

    @@ -823,7 +823,7 @@

    Formatting Table Ce
  • fmt(): set a column format with a formatting function
  • We strive to make formatting a simple task but we also want to provide the user a lot of power through advanced options and we ensure that varied combinations of options works well. For example, most of the formatting methods have a locale= argument. We want as many users as possible to be able to format numbers, dates, and times in ways that are familiar to them and are adapted to their own regional specifications. Now let’s take a look at an example of this with a smaller version of the exibble dataset:

    -
    +
    exibble_smaller = exibble[["date", "time"]].head(4)
     
     (
    @@ -833,52 +833,52 @@ 

    Formatting Table Ce .fmt_time(columns="time", time_style="h_m_s_p") )

    -
    +

    @@ -920,7 +920,7 @@

    Formatting Table Ce

    Using Styles within a Table

    We can use the tab_style() method in combination with loc.body() and various style.*() functions to set styles on cells of data within the table body. For example, the table-making code below applies a yellow background color to the targeted cells.

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import airquality
     
    @@ -934,52 +934,52 @@ 

    Using Styles w ) )

    -
    +

    @@ -1045,7 +1045,7 @@

    Using Styles w

    Aside from style.fill() we can also use style.text() and style.borders() to focus the styling on cell text and borders. Here’s an example where we perform several types of styling on targeted cells (the key is to put the style.*() calls in a list).

    -
    +
    from great_tables import GT, style, exibble
     
     (
    @@ -1068,52 +1068,52 @@ 

    Using Styles w ) )

    -
    +

    @@ -1170,7 +1170,7 @@

    Using Styles w

    Column Selection with Polars (and How It Helps with Styling)

    Styles can also be specified using Polars expressions. For example, the code below uses the Temp column to set color to "lightyellow" or "lightblue".

    -
    +
    import polars as pl
     
     from great_tables import GT, from_column, style, loc
    @@ -1194,52 +1194,52 @@ 

    ) )

    -
    +

    @@ -1305,7 +1305,7 @@

    +
    import polars.selectors as cs
     
     (
    @@ -1319,52 +1319,52 @@ 

    ) )

    -
    +

    diff --git a/blog/latex-output-tables/index.html b/blog/latex-output-tables/index.html index dbc7f03b5..a52e85964 100644 --- a/blog/latex-output-tables/index.html +++ b/blog/latex-output-tables/index.html @@ -232,7 +232,7 @@

    Great Tables: Generating LaTeX Output for PDF

    Generating a LaTeX table with Great Tables

    We can use the GT.as_latex() method to generate LaTeX table code. This code includes important structural pieces like titles, spanners, and value formatting. For example, here’s a simple table output as LaTeX code:

    -
    +
    Show the Code
    from great_tables import GT
    @@ -395,55 +395,55 @@ 

    Current limitations of LaTeX table output

    The as_latex() method is still experimental and has some limitations. The following table lists the work epics that have been done and those planned:

    -
    +
    -
    +
    diff --git a/blog/open-transit-tools/index.html b/blog/open-transit-tools/index.html index baea0f3c0..a0f9788a2 100644 --- a/blog/open-transit-tools/index.html +++ b/blog/open-transit-tools/index.html @@ -241,7 +241,7 @@

    Contributing to Public Transit Data Analysis and Tooling

    Why focus on open source in public transit?

    -

    People doing analytics in public transit are active in developing open data standards (like GTFS, GTFS-RT, and TIDES). These open data sources are complex—they cover schedules that change from week to week, busses moving in realtime, and passenger events. As people like me work more and more on open source tools, we start to lose touch with data analysis in realistic, complex settings. Working on open source transit data is an opportunity for me to ensure my open source tooling work helps people solve real, complex problems.

    +

    People doing analytics in public transit are active in developing open data standards (like GTFS, GTFS-RT, and TIDES). These open data sources are complex—they cover schedules that change from week to week, buses moving in realtime, and passenger events. As people like me work more and more on open source tools, we start to lose touch with data analysis in realistic, complex settings. Working on open source transit data is an opportunity for me to ensure my open source tooling work helps people solve real, complex problems.

    An inspiration for this angle is the book R for Data Science, which uses realistic datasets—like NYC flights data—to teach data analysis using an ecosystem of packages called the Tidyverse. The Tidyverse packages have dozens of example datasets, and I think this focus on working through examples is part of what made their design so great.

    A few years ago, I worked with the Cal-ITP project to build out a warehouse for their GTFS schedule and realtime data. This left a profound impression on me: transit data is perfect for educating on data analyses in R and Python, as well as analytics engineering with tools like dbt or sqlmesh. Many analysts in public transit are querying warehouses, which opens up interesting use-cases with tools like dbplyr (in R) and ibis (in Python).

    (I’m also inspired by tools like tidytransit, and other communities like pharmaverse.org.)

    @@ -257,7 +257,7 @@

    Why i

    Great Tables data: Paris metro lines

    If you’ve seen the Great Tables documentation for GT.fmt_image(), then you’ve basked in this beautiful example from our Paris metro dataset.

    -
    +
    Code
    from great_tables import GT
    @@ -275,52 +275,52 @@ 

    Great )

    -
    +

    @@ -426,7 +426,7 @@

    Workshops

    Collaboration

    I’m interested in understanding major challenges analytics teams working on public transit face, and the kind of strategic and tooling support they’d most benefit from. If you’re working on analytics in public transit, I would love to hear about what you’re working on, and the tools you use most.

    -

    One topic I’ve discussed with a few agencies is ghost busses, which is when a bus is scheduled but never shows up. This is an interesting analysis because it combines GTFS schedule data with GTFS-RT realtime bus data.

    +

    One topic I’ve discussed with a few agencies is ghost buses, which is when a bus is scheduled but never shows up. This is an interesting analysis because it combines GTFS schedule data with GTFS-RT realtime bus data.

    Another is passenger events (e.g. people tapping on or off a bus). This data is challenging because different vendors data record and deliver this data in different ways. This can make it hard for analysts across agencies to discuss analyses—every analysis is different in its own way.

    diff --git a/blog/polars-styling/index.html b/blog/polars-styling/index.html index b6ecfbf35..c03f3fdde 100644 --- a/blog/polars-styling/index.html +++ b/blog/polars-styling/index.html @@ -228,7 +228,7 @@

    Great Tables: The Polars DataFrame Styler of Your Dreams

    However, there are fewer options for styling tables for presentation. You could convert from polars to pandas, and use the built-in pandas DataFrame styler, but this has one major limitation: you can’t use polars expressions.

    As it turns out, polars expressions make styling tables very straightforward. The same polars code that you would use to select or filter combines with Great Tables to highlight, circle, or bolden text.

    In this post, I’ll show how Great Tables uses polars expressions to make delightful tables, like the one below.

    -
    +
    Code
    import polars as pl
    @@ -283,52 +283,52 @@ 

    Great Tables: The Polars DataFrame Styler of Your Dreams

    )
    -
    +
    @@ -477,7 +477,7 @@

    Th

    Creating GT object

    First, we’ll import the necessary libraries, and do a tiny bit of data processing.

    -
    +
    import polars as pl
     import polars.selectors as cs
     
    @@ -503,57 +503,57 @@ 

    Creating GT object

    The default polars output above is really helpful for data analysis! By passing it to the GT constructor, we can start getting it ready for presentation.

    -
    +
    gt_air = GT(pl_airquality)
     
     gt_air
    -
    +

    @@ -629,7 +629,7 @@

    Creating GT object

    Set title and subtitle

    The simplest method in gt is GT.tab_header(), which lets you add a title and subtitle.

    -
    +
    (
         gt_air
     
    @@ -640,52 +640,52 @@ 

    Set title and subti ) )

    -
    +
    @@ -767,7 +767,7 @@

    Set title and subti

    Set body styles

    The .tab_style() method sets styles—like fill color, or text properties—on different parts of the table. Let’s use it twice with a polars expression. First to highlight the row corresponding to the max Wind value, and then to bold that value.

    -
    +
    from great_tables import style, loc
     
     is_max_wind = pl.col("Wind") == pl.col("Wind").max()
    @@ -789,52 +789,52 @@ 

    Set body styles

    ) )
    -
    +

    @@ -921,7 +921,7 @@

    Set column spannersMore readable labels for columns themselves.

    Use GT.tab_spanner() to set labels on groups of columns.

    -
    +
    time_cols = ["Year", "Month", "Day"]
     
     gt_with_spanners = (
    @@ -940,52 +940,52 @@ 

    Set column spanners gt_with_spanners

    -
    +

    @@ -1066,7 +1066,7 @@

    Set column spanners

    Notice that there are now labels for “Time” and “Measurement” sitting above the column names. This is useful for emphasizing columns that share something in common.

    Use GT.cols_labels() with html() to create human-friendly labels (e.g. convert things like cal_m_2 to cal/m2).

    -
    +
    from great_tables import html
     
     (
    @@ -1079,52 +1079,52 @@ 

    Set column spanners ) )

    -
    +

    @@ -1209,7 +1209,7 @@

    Set column spanners

    Putting it all together

    Finally, we’ll combine everything from the sections above into a single block of code, and use a few more rows of data.

    -
    +
    Code
    import polars as pl
    @@ -1264,52 +1264,52 @@ 

    Putting it all tog )

    -
    +
    diff --git a/blog/rendering-images/index.html b/blog/rendering-images/index.html index 1fc6f4e8d..147f0e0cb 100644 --- a/blog/rendering-images/index.html +++ b/blog/rendering-images/index.html @@ -273,7 +273,7 @@

    Rendering Ima

    Preparations

    For this demonstration, we’ll use the first five rows of the built-in metro dataset, specifically the name and lines columns.

    To ensure a smooth walkthrough, we’ll manipulate the data (a Python dictionary) directly. However, in real-world applications, such operations are more likely performed at the DataFrame level to leverage the benefits of vectorized operations.

    -
    +
    Show the Code
    import pandas as pd
    @@ -324,7 +324,7 @@ 

    Preparations

    Case 1: Local File Paths

    Case 1 demonstrates how to simulate a column containing strings representing local file paths. We’ll use images stored in the data/metro_images directory of Great Tables:

    -
    +
    1img_local_paths = files("great_tables") / "data/metro_images"
    @@ -336,7 +336,7 @@

    Case 1: Local File

    Below is a Pandas DataFrame called metro_mini1, where the case1 column contains local file paths that we want to render as images.

    -
    +
    Show the Code
    metro_mini1 = pd.DataFrame(
    @@ -414,7 +414,7 @@ 

    Case 1: Local File

    Local file paths can vary depending on the operating system, which makes it easy to accidentally construct invalid paths. A good practice to mitigate this is to use Python’s built-in pathlib module to construct paths first and then convert them to strings. In this example, img_local_paths is actually an instance of pathlib.Path.

    -
    +
    from pathlib import Path
     
     isinstance(img_local_paths, Path)  # True
    @@ -424,55 +424,55 @@

    Case 1: Local File

    The case1 column is quite lengthy due to the inclusion of img_local_paths. In Case 3, we’ll share a useful trick to avoid repeating the directory name each time—stay tuned!

    For now, let’s use GT.fmt_image() to render images by passing "case1" as the first argument:

    -
    +
    GT(metro_mini1).fmt_image("case1").cols_align(align="right", columns="case1")
    -
    +

    @@ -523,11 +523,11 @@

    Case 1: Local File

    Case 2: Full HTTP/HTTPS URLs

    Case 2 demonstrates how to simulate a column containing strings representing HTTP/HTTPS URLs. We’ll use the same images as in Case 1, but this time, retrieve them from the Great Tables GitHub repository:

    -
    +
    img_url_paths = "https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images"

    Below is a Pandas DataFrame called metro_mini2, where the case2 column contains full HTTP/HTTPS URLs that we aim to render as images.

    -
    +
    Show the Code
    metro_mini2 = pd.DataFrame(
    @@ -591,55 +591,55 @@ 

    Case 2: Full HT

    The lengthy case2 column issue can also be addressed using the trick shared in Case 3.

    Similarly, we can use GT.fmt_image() to render images by passing "case2" as the first argument:

    -
    +
    GT(metro_mini2).fmt_image("case2").cols_align(align="right", columns="case2")
    -
    +

    @@ -691,7 +691,7 @@

    Case 2: Full HT

    Case 3: Image Names with the path= Argument

    Case 3 demonstrates how to use the path= argument to specify images relative to a base directory or URL. This approach eliminates much of the repetition in file names, offering a solution to the issues in Case 1 and Case 2.

    Below is a Pandas DataFrame called metro_mini3, where the case3 column contains file names that we aim to render as images.

    -
    +
    Show the Code
    metro_mini3 = pd.DataFrame(
    @@ -753,7 +753,7 @@ 

    Now we can use GT.fmt_image() to render the images by passing "case3" as the first argument and specifying either img_local_paths or img_url_paths as the path= argument:

    -
    +
    # equivalent to `Case 1`
     (
         GT(metro_mini3)
    @@ -768,52 +768,52 @@ 

    .cols_align(align="right", columns="case3") )

    -
    +
    @@ -866,7 +866,7 @@

    Case 4: Image Names Using Both the path= and file_pattern= Arguments

    Case 4 demonstrates how to use path= and file_pattern= to specify images with names following a common pattern. For example, you could use file_pattern="metro_{}.svg" to reference images like metro_1.svg, metro_2.svg, and so on.

    Below is a Pandas DataFrame called metro_mini4, where the case4 column contains a copy of data["lines"], which we aim to render as images.

    -
    +
    Show the Code
    metro_mini4 = pd.DataFrame({**data, "case4": data["lines"]})
    @@ -921,11 +921,11 @@ 

    +
    file_pattern = "metro_{}.svg"

    Next, pass "case4" as the first argument, along with img_local_paths or img_url_paths as the path= argument, and file_pattern as the file_pattern= argument. This allows GT.fmt_image() to render the images:

    -
    +
    # equivalent to `Case 1`
     (
         GT(metro_mini4)
    @@ -940,52 +940,52 @@ 

    .cols_align(align="right", columns="case4") )

    -
    +

    @@ -1045,7 +1045,7 @@

    The file_pattern= argument is typically used in conjunction with the path= argument, but this is not a strict rule. If your local file paths or HTTP/HTTPS URLs follow a pattern, you can use file_pattern= alone without path=. This allows you to include the shared portion of the file paths or URLs directly in file_pattern, as shown below:

    -
    +
    file_pattern = str(img_local_paths / "metro_{}.svg")
     (
         GT(metro_mini4)
    @@ -1053,52 +1053,52 @@ 

    .cols_align(align="right", columns="case4") )

    -
    +

    @@ -1158,7 +1158,7 @@

    Rendering Images

    Preparations

    We will create a Pandas DataFrame named metro_mini using the data dictionary. This will be used for demonstration in the following examples:

    -
    +
    Show the Code
    metro_mini = pd.DataFrame(data)
    @@ -1210,7 +1210,7 @@ 

    Preparations

    Single Image

    This example shows how to render a valid URL as an image in the title of the table header:

    -
    +
    gt_logo_url = "https://posit-dev.github.io/great-tables/assets/GT_logo.svg"
     
     1_gt_logo, *_ = vals.fmt_image(gt_logo_url, height=100)
    @@ -1232,52 +1232,52 @@ 

    Single Image

    -
    +

    @@ -1325,7 +1325,7 @@

    Single Image

    Multiple Images

    This example demonstrates how to render two valid URLs as images in the title and subtitle of the table header:

    -
    +
    metro_logo_url = "https://raw.githubusercontent.com/rstudio/gt/master/images/dataset_metro.svg"
     logo_urls = [gt_logo_url, metro_logo_url]
     
    @@ -1348,52 +1348,52 @@ 

    Multiple Images

    -
    +
    @@ -1445,7 +1445,7 @@

    Multiple Images

    Manually Rendering Images Anywhere

    Remember, you can always use html() to manually construct your desired output. For example, the previous table can be created without relying on vals.fmt_image() like this:

    -
    +
    (
         GT(metro_mini)
         .fmt_image("lines", path=img_url_paths, file_pattern="metro_{}.svg")
    diff --git a/blog/superbowl-squares/index.html b/blog/superbowl-squares/index.html
    index 4dd5e2da8..fb8a1889f 100644
    --- a/blog/superbowl-squares/index.html
    +++ b/blog/superbowl-squares/index.html
    @@ -238,7 +238,7 @@ 

    What is Super B
  • Away team digit: 7
  • Let’s say you choose the digits above, and write this as 4/7—meaning a final digit of 4 for home and 7 for away. You would mark yourself on this square:

    -
    +
    Code
    df = (
    @@ -262,52 +262,52 @@ 

    What is Super B )

    -
    +

    @@ -485,7 +485,7 @@

    Why analyze squares?

    What squares are most likely to win?

    We looked back at games for the KC Chiefs (away), and games for the San Francisco 49ers (home), and calculated the proportion of the time each team ended with a specific digit. Putting this together for the two teams, here is the chance of winning on a given square:

    -
    +
    Code
    import polars as pl
    @@ -558,52 +558,52 @@ 

    What s )

    -
    +
    @@ -818,7 +818,7 @@

    Method

    Code

    -
    +
    import polars as pl
     import polars.selectors as cs
     from great_tables import GT, md
    @@ -888,52 +888,52 @@ 

    Code

    ) )
    -
    +
    diff --git a/blog/tables-for-scientific-publishing/index.html b/blog/tables-for-scientific-publishing/index.html index 3eaab81fb..172eae624 100644 --- a/blog/tables-for-scientific-publishing/index.html +++ b/blog/tables-for-scientific-publishing/index.html @@ -253,7 +253,7 @@

    Unit and scie
  • formatting for very small numbers in scientific notation.
  • Great Tables provides the necessary functionality for all three requirements. Here is a summary table that tabulates rate constants for mercaptan compounds undergoing reaction with OH, O3, and Cl:

    -
    +
    Show the Code
    from great_tables import GT
    @@ -299,52 +299,52 @@ 

    Unit and scie )

    -
    +

    @@ -466,7 +466,7 @@

    Nanoplots

    We added the nanoplots feature to Great Tables in v0.4.0 (check out the intro blog post for a quick explainer) so that tables can contain small, info-packed plots that fit reasonably well into a table context. They are interactive in that hovering over the data points provides additional plot information. This approach brings together the advantages of plots (elucidation of trends in data) and tables (access to numerical values representing the data points) in a single summary visualization.

    Version 0.10.0 of Great Tables adds the gibraltar dataset, which provides meteorological data (temeperature, humidity, wind speed, etc.) for the entire month of May 2024 at Gibraltar Airport Station.

    Nanoplots, as mentioned, are great for condensing a lot of information into a small area. Our example here with the gibraltar dataset takes all of the temperature and humidity data for the first 10 days of May 2023 and displays them in easy-to-explore nanoplots across two columns:

    -
    +
    Show the Code
    from great_tables import GT, nanoplot_options
    @@ -523,52 +523,52 @@ 

    Nanoplots

    )
    -
    +
    diff --git a/examples/index.html b/examples/index.html index d0364c1fb..97d510fbe 100644 --- a/examples/index.html +++ b/examples/index.html @@ -205,7 +205,7 @@

    Examples

    -
    +
    Show the Code
    import polars as pl
    @@ -233,52 +233,52 @@ 

    Examples

    )
    -
    +
    @@ -358,7 +358,7 @@

    Examples

    -
    +
    Show the Code
    from great_tables import GT, html
    @@ -390,52 +390,52 @@ 

    Examples

    )
    -
    +
    @@ -567,7 +567,7 @@

    Examples

    -
    +
    Show the Code
    from great_tables import GT
    @@ -608,52 +608,52 @@ 

    Examples

    )
    -
    +
    @@ -800,7 +800,7 @@

    Examples

    -
    +
    Show the Code
    from great_tables import GT, html
    @@ -841,52 +841,52 @@ 

    Examples

    )
    -
    +
    @@ -977,7 +977,7 @@

    Examples

    -
    +
    Show the Code
    from great_tables import GT, html
    @@ -1008,52 +1008,52 @@ 

    Examples

    )
    -
    +
    @@ -1468,54 +1468,54 @@

    Examples

    View source ⬀     Blog post (R code) ⬀

    -
    +
    -
    +
    @@ -2025,7 +2025,7 @@

    Examples

    View source ⬀     Notebook ⬀

    -
    +
    Show the Code
    import polars as pl
    @@ -2082,52 +2082,52 @@ 

    Examples

    coffee_table
    -
    +
    diff --git a/get-started/basic-column-labels.html b/get-started/basic-column-labels.html index 1534f9927..d888a061c 100644 --- a/get-started/basic-column-labels.html +++ b/get-started/basic-column-labels.html @@ -398,7 +398,7 @@

    Column Labels

  • Month, Day: the numeric month and day of month for the record
  • We know that all measurements took place in 1973, so a year column will be added to the dataset before it is passed to the GT() class.

    -
    +
    from great_tables import GT, html
     from great_tables.data import airquality
     
    @@ -530,7 +530,7 @@ 

    Column Labels

    Adding Column Spanners

    Let’s organize the time information under a Time spanner label, and put the other columns under a Measurement spanner label. We can do this with the tab_spanner() method.

    -
    +
    gt_airquality = (
         GT(airquality_mini)
         .tab_header(
    @@ -549,52 +549,52 @@ 

    Adding Column Spann gt_airquality

    -
    +
    @@ -733,7 +733,7 @@

    Moving and R
  • customize the column labels so that they are more descriptive (using cols_label())
  • Let’s do both of these things in the next example:

    -
    +
    (
         gt_airquality
         .cols_move_to_start(columns=["Year", "Month", "Day"])
    @@ -745,52 +745,52 @@ 

    Moving and R ) )

    -
    +

    @@ -927,58 +927,58 @@

    Moving and R

    Targeting Columns for columns=

    In the above examples, we selected columns to span or move using a list of column names (as strings). However, Great Tables supports a wide range of ways to select columns.

    For example, you can use a lambda function:

    -
    +
    (
         GT(airquality_mini)
         .cols_move_to_start(columns=lambda colname: colname.endswith("R"))
     )
    -
    +
    diff --git a/get-started/basic-formatting.html b/get-started/basic-formatting.html index affe8af8f..d0802bec9 100644 --- a/get-started/basic-formatting.html +++ b/get-started/basic-formatting.html @@ -387,7 +387,7 @@

    Formatting Values

    The values within the table body, specifically those within the body cells, can be formatted with a large selection of fmt_*() methods like fmt_number(), fmt_integer(), fmt_scientific(), and more. Let’s use a portion of the exibble dataset and introduce some formatting to the cell values. First, we’ll generate the basic GT object and take a look at the table without any cell formatting applied.

    -
    +
    from great_tables import GT
     from great_tables.data import exibble
     from great_tables import vals
    @@ -396,52 +396,52 @@ 

    Formatting Values

    gt_ex
    -
    +
    @@ -495,57 +495,57 @@

    Formatting Values

    The num column contains both small and much larger numbers. We can use the fmt_number() method to obtain formatted values have a fixed level of decimal precision and grouping separators. At the same time, we’ll format the numeric values in currency column to get monetary values.

    -
    +
    gt_ex = gt_ex.fmt_number(columns="num", decimals=2).fmt_currency(columns="currency")
     
     gt_ex
    -
    +
    @@ -599,7 +599,7 @@

    Formatting Values

    Dates and times can be formatted as well. As long as they are in ISO 8601 form, the fmt_date() and fmt_time() methods can be used to format such values. These methods have corresponding date_style= and time_style= arguments that accept a number of keywords that act as preset formatting styles.

    -
    +
    gt_ex = (
         gt_ex.fmt_date(columns="date", date_style="m_day_year")
         .fmt_time(columns="time", time_style="h_m_p")
    @@ -607,52 +607,52 @@ 

    Formatting Values

    gt_ex
    -
    +
    @@ -706,57 +706,57 @@

    Formatting Values

    It’s possible to format cells that have already been formatted. Using a formatting method again on previously formatted cells will always work within the ‘last-formatted-wins’ rule.

    -
    +
    gt_ex = gt_ex.fmt_date(columns="date", date_style="wday_day_month_year")
     
     gt_ex
    -
    +
    @@ -810,57 +810,57 @@

    Formatting Values

    Within the selected columns= we can choose to target specific cells with the rows= argument. The latter argument allows us to pass in a list of row indices.

    -
    +
    gt_ex = gt_ex.fmt_currency(columns="currency", rows=[2, 3, 4], currency="GBP")
     
     gt_ex
    -
    +
    @@ -925,7 +925,7 @@

    , "fr", "de-AT", etc.) will result in numeric formatting specific to the chosen locale

    Here are a number of examples that use vals.fmt_number().

    -
    +
    fmt_number_1 = vals.fmt_number([1.64, 3.26, 3000.63, 236742.37])
     fmt_number_2 = vals.fmt_number([1.64, 3.26, 3000.63, 236742.37], compact=True)
     fmt_number_3 = vals.fmt_number([1.64, 3.26, 3000.63, 236742.37], decimals=3)
    @@ -942,7 +942,7 @@ 

    vals.fmt_scientific().

    -
    +
    fmt_sci_1 = vals.fmt_scientific([0.00064, 7.353, 863454.63])
     fmt_sci_2 = vals.fmt_scientific([1.64, 3.26, 3000.63], decimals=3)
     fmt_sci_3 = vals.fmt_scientific([1.64, 3.26, 3000.63], exp_style="E")
    @@ -957,7 +957,7 @@ 

    vals.fmt_date() and vals.fmt_time().

    -
    +
    fmt_date_1 = vals.fmt_date(
         ["2015-03-15", "2017-08-18", "2020-04-12"], date_style="wday_month_day_year"
     )
    diff --git a/get-started/basic-header.html b/get-started/basic-header.html
    index 0552faab9..0483d3aff 100644
    --- a/get-started/basic-header.html
    +++ b/get-started/basic-header.html
    @@ -381,7 +381,7 @@ 

    Header and Footer

    The way that we add components like the Table Header and source notes in the Table Footer is to use the tab_*() family of methods. A Table Header is easy to add so let’s see how the previous table looks with a title and a subtitle. We can add this component using the tab_header() method:

    -
    +
    from great_tables import GT, md, html
     from great_tables.data import islands
     
    @@ -397,52 +397,52 @@ 

    Header and Footer

    ) )
    -
    +

    @@ -510,7 +510,7 @@

    Header and Footer

    The Header table component provides an opportunity to describe the data that’s presented. Using subtitle= allows us to insert a subtitle, which is an optional part of the Header. We may also style the title= and subtitle= using Markdown! We do this by wrapping the values passed to title= or subtitle= with the md() helper function (we may also use html() in a similar fashion). Here is an example with the table data truncated for brevity:

    -
    +
    # Make a display table with the `islands_tbl` table;
     # put a heading just above the column labels
     gt_tbl = (
    @@ -523,52 +523,52 @@ 

    Header and Footer

    gt_tbl
    -
    +
    @@ -604,7 +604,7 @@

    Header and Footer

    A source note can be added to the table’s Footer through use of the tab_source_note() method. It works in the same way as tab_header() (it also allows for Markdown inputs) except it can be called multiple times—each invocation results in the addition of a source note.

    -
    +
    # Display the `islands_tbl` data with a heading and two source notes
     (
         gt_tbl
    @@ -616,52 +616,52 @@ 

    Header and Footer

    ) )
    -
    +
    diff --git a/get-started/basic-stub.html b/get-started/basic-stub.html index 0ab5ba6d3..239cfd6c7 100644 --- a/get-started/basic-stub.html +++ b/get-started/basic-stub.html @@ -392,7 +392,7 @@

    Stub (Row Labels)

    Row names

    An easy way to generate a Stub part is by specifying a stub column in the GT() class with the rowname_col= argument. This will signal to Great Tables that the named column should be used as the stub, using the contents of that column to make row labels. Let’s add a stub with our islands dataset by using rowname_col= in the call to GT():

    -
    +
    from great_tables import GT, md, html
     from great_tables.data import islands
     
    @@ -400,52 +400,52 @@ 

    Row names

    GT(islands_mini).tab_stub(rowname_col="name")
    -
    +
    @@ -507,59 +507,59 @@

    Row names

    Notice that the landmass names are now placed to the left? That’s the Stub. Notably, there is a prominent border to the right of it but there’s no label above the Stub. We can change this and apply what’s known as a stubhead label through use of the tab_stubhead() method:

    -
    +
    (
         GT(islands_mini)
         .tab_stub(rowname_col="name")
         .tab_stubhead(label="landmass")
     )
    -
    +
    @@ -625,7 +625,7 @@

    Row names

    Row groups

    Let’s incorporate row groups into the display table. This divides rows into groups, creating row groups, and results in a display of a row group labels right above the each group. This can be easily done with a table containing row labels and the key is to use the groupname_col= argument of the GT() class. Here we will create three row groups (with row group labels "continent", "country", and "subregion") to have a grouping of rows.

    -
    +
    island_groups = islands.head(10).assign(group = ["subregion"] * 2 + ["country"] * 2 + ["continent"] * 6)
     
     (
    @@ -634,52 +634,52 @@ 

    Row groups

    .tab_stubhead(label="landmass") )
    -
    +
    @@ -753,55 +753,55 @@

    Row groups

    GT convenience arguments

    Rather than using the GT.tab_stub() method, the GT(rowname_col=..., groupname_col=...) arguments provide a quick way to specify row names and groups.

    -
    +
    GT(island_groups, rowname_col="name", groupname_col="group")
    -
    +
    diff --git a/get-started/basic-styling.html b/get-started/basic-styling.html index b43f40a73..e245e5345 100644 --- a/get-started/basic-styling.html +++ b/get-started/basic-styling.html @@ -405,7 +405,7 @@

    Styling the Table Body

    Great Tables can add styles—like color, text properties, and borders—on many different parts of the displayed table. The following set of examples shows how to set styles on the body of table, where the data cells are located.

    For the examples on this page, we’ll use the included airquality dataset to set up GT objects for both Pandas and Polars DataFrames.

    -
    +
    import polars as pl
     
     from great_tables import GT, from_column, style, loc
    @@ -419,58 +419,58 @@ 

    Styling the Table Body

    Style basics

    We use the tab_style() method in combination with loc.body() to set styles on cells of data in the table body. For example, the table-making code below applies a yellow background color to specific cells.

    -
    +
    gt_air.tab_style(
         style=style.fill(color="yellow"),
         locations=loc.body(columns="Temp", rows=[1, 2])
     )
    -
    +
    @@ -544,58 +544,58 @@

    Style basics

    Customizing Borders

    Let’s use style.borders() to place borders around targeted cells. In this next example, the table has a red dashed border above two rows.

    -
    +
    gt_air.tab_style(
         style=style.borders(sides="top", color="red", style="dashed", weight="3px"),
         locations=loc.body(rows=[1, 2])
     )
    -
    +
    @@ -664,58 +664,58 @@

    Customizing Borders

    Customizing Text

    We can style text with by using the style.text() function. This gives us many customization possibilities for any text we target. For example, the Solar_R column below has green, bolded text in a custom font.

    -
    +
    gt_air.tab_style(
         style=style.text(color="green", font="Times New Roman", weight="bold"),
         locations=loc.body(columns="Solar_R")
     )
    -
    +
    @@ -785,7 +785,7 @@

    Customizing Text

    Column-based Styles

    In addition to setting styles to specific values (e.g., a "yellow" background fill), you can also use parameter values from table columns to specify styles. The way to do this is to use the from_column() helper function to access those values.

    -
    +
    df = pl.DataFrame({"x": [1, 2], "background": ["lightyellow", "lightblue"]})
     
     (
    @@ -796,52 +796,52 @@ 

    Column-based Styles ) )

    -
    +
    @@ -875,7 +875,7 @@

    Column-based Styles

    Combining Styling with cols_hide()

    One common approach is to specify a style from a column, and then hide that column in the final output. For example, we can add a background column to our airquality data:

    -
    +
    color_map = {
         True: "lightyellow",
         False: "lightblue"
    @@ -960,7 +960,7 @@ 

    Combining

    Notice that the dataset now has a background column set to either "lightyellow" or "lightblue", depending on whether Temp is above 70.

    We can then use this background column to set the fill color of certain body cells, and then hide the background column since we don’t need that in our finalized display table:

    -
    +
    (
         GT(with_color)
         .tab_style(
    @@ -970,52 +970,52 @@ 

    Combining .cols_hide(columns="background") )

    -
    +
    @@ -1089,7 +1089,7 @@

    Combining

    Using Polars expressions

    Styles can also be specified using Polars expressions. For example, the code below uses the Temp column to set color to "lightyellow" or "lightblue".

    -
    +
    # A Polars expression defines color based on `Temp`
     temp_color = (
         pl.when(pl.col("Temp") > 70)
    @@ -1102,52 +1102,52 @@ 

    Using Pol locations=loc.body("Temp") )

    -
    +

    @@ -1217,7 +1217,7 @@

    Using Pol

    Using functions

    You can also use a function, that takes the DataFrame and returns a Series with a style value for each row.

    This is shown below on a pandas DataFrame.

    -
    +
    def map_color(df):
         return (df["Temp"] > 70).map(
             {True: "lightyellow", False: "lightblue"}
    @@ -1229,52 +1229,52 @@ 

    Using functions

    locations=loc.body("Temp") )
    -
    +

    @@ -1346,7 +1346,7 @@

    Specifying col

    Using polars selectors

    If you are using Polars, you can use column selectors and expressions for selecting specific columns and rows:

    -
    +
    import polars.selectors as cs
     
     gt_pl_air.tab_style(
    @@ -1357,52 +1357,52 @@ 

    Using polars select ) )

    -
    +

    @@ -1472,7 +1472,7 @@

    Using polars select

    Using a function

    For tools like pandas, you can use a function (or lambda) to select rows. The function should take a DataFrame, and output a boolean Series.

    -
    +
    gt_air.tab_style(
         style=style.fill(color="yellow"),
         locations=loc.body(
    @@ -1481,52 +1481,52 @@ 

    Using a function

    ) )
    -
    +

    @@ -1596,58 +1596,58 @@

    Using a function

    Multiple styles and locations

    We can use a list within style= to apply multiple styles at once. For example, the code below sets fill and border styles on the same set of body cells.

    -
    +
    gt_air.tab_style(
         style=[style.fill(color="yellow"), style.borders(sides="all")],
         locations=loc.body(columns="Temp", rows=[1, 2]),
     )
    -
    +
    @@ -1713,7 +1713,7 @@

    Multiple sty

    Note that you can also pass a list to locations=!

    -
    +
    gt_air.tab_style(
         style=style.fill(color="yellow"),
         locations=[
    @@ -1722,52 +1722,52 @@ 

    Multiple sty ] )

    -
    +

    @@ -1833,7 +1833,7 @@

    Multiple sty

    You can also combine Polars selectors with a row filtering expression, in order to select a combination of columns and rows.

    -
    +
    import polars.selectors as cs
     
     gt_pl_air.tab_style(
    @@ -1844,52 +1844,52 @@ 

    Multiple sty ) )

    -
    +

    diff --git a/get-started/colorizing-with-data.html b/get-started/colorizing-with-data.html index 10fea5be6..f82c0b5a6 100644 --- a/get-started/colorizing-with-data.html +++ b/get-started/colorizing-with-data.html @@ -391,7 +391,7 @@

    Colorizing with Data

    You sometimes come across heat maps in data visualization, and they’re used to represent data values with color gradients. This technique is great for identifying patterns, trends, outliers, and missing data when there’s lots of data. Tables can have this sort of treatment as well! Typically, formatted numeric values are shown along with some color treatment coinciding with the underlying data values.

    We can make this possible in Great Tables by using the data_color() method. Let’s start with a simple example, using a Polars DataFrame with three columns of values. We can introduce that data to GT() and use data_color() without any arguments.

    -
    +
    from great_tables import GT
     import polars as pl
     
    @@ -405,52 +405,52 @@ 

    Colorizing with Data

    GT(simple_df).data_color()
    -
    +
    @@ -501,55 +501,55 @@

    Colorizing with Data

    Setting palette colors

    While this first example illustrated some basic things, the common thing to do in practices to provide a list of colors to the palette= argument. Let’s choose two colors "green" and "red" and place them in that order.

    -
    +
    GT(simple_df).data_color(palette=["blue", "red"])
    -
    +
    @@ -601,55 +601,55 @@

    Setting palette col

    Coloring missing values with na_color

    There is a lone "None" value in the float column, and it has a gray background. Thoughout the Great Tables package, missing values are treated in different ways and, in this case, it’s given a default color value. We can change that with the na_color= argument. Let’s try it now:

    -
    +
    GT(simple_df).data_color(palette=["blue", "red"], na_color="#FFE4C4")
    -
    +

    @@ -701,7 +701,7 @@

    Colo

    Using domain= to color values across columns

    The previous usages of the data_color() method were such that the color ranges encompassed the boundaries of the data values. That can be changed with the domain= argument, which expects a list of two values (a lower and an upper value). Let’s use the range [0, 10] on the first two columns, integer and float, and not the third (since a numerical domain is incompatible with string-based values). Here’s the table code for that:

    -
    +
    (
         GT(simple_df)
         .data_color(
    @@ -712,52 +712,52 @@ 

    ) )

    -
    +

    @@ -810,7 +810,7 @@

    Bringing it all together

    For a more advanced treatment of data colorization in the table, let’s take the sza dataset (available in the great_tables.data submodule) and vigorously reshape it with Polars so that solar zenith angles are arranged as rows by month, and the half-hourly clock times are the columns (from early morning to solar noon).

    Once the pivot()ing is done, we can introduce that that table to the GT() class, placing the names of the months in the table stub. We will use data_color() with a domain that runs from 90 to 0 (here, 90° is sunrise, and 0° is represents the sun angle that’s directly overhead). There are months where the sun rises later in the morning, before the sunrise times we’ll see missing values in the dataset, and na_color="white" will handle those cases. Okay, that’s the plan, and now here’s the code:

    -
    +
    from great_tables import html
     from great_tables.data import sza
     import polars.selectors as cs
    @@ -836,52 +836,52 @@ 

    Bringing it all t ) )

    -
    +
    diff --git a/get-started/column-selection.html b/get-started/column-selection.html index 0c6cf6ff1..7832fba9c 100644 --- a/get-started/column-selection.html +++ b/get-started/column-selection.html @@ -397,7 +397,7 @@

    Column Selection

  • a Polars selector.
  • a function that takes a string and returns True or False.
  • -
    +
    from great_tables import GT
     from great_tables.data import exibble
     
    @@ -406,52 +406,52 @@ 

    Column Selection

    gt_ex
    -
    +
    @@ -506,55 +506,55 @@

    Column Selection

    Using integers

    We can use a list of strings or integers to select columns by name or position, respectively.

    -
    +
    gt_ex.cols_move_to_start(columns=["date", 1, -1])
    -
    +
    @@ -617,7 +617,7 @@

    Using integers

    Using Polars selectors

    When using a Polars DataFrame, you can select columns using Polars selectors. The example below uses Polars selectors to move all columns that start with "c" or "f" to the start of the table.

    -
    +
    import polars as pl
     import polars.selectors as cs
     
    @@ -625,52 +625,52 @@ 

    Using Polar GT(pl_df).cols_move_to_start(columns=cs.starts_with("c") | cs.starts_with("f"))

    -
    +
    @@ -723,7 +723,7 @@

    Using Polar

    In general, selection should match the behaviors of the Polars DataFrame.select() method.

    -
    +
    pl_df.select(cs.starts_with("c") | cs.starts_with("f")).columns
    ['char', 'fctr']
    @@ -734,55 +734,55 @@

    Using Polar

    Using functions

    A function can be used to select columns. It should take a column name as a string and return True or False.

    -
    +
    gt_ex.cols_move_to_start(columns=lambda x: "c" in x)
    -
    +

    diff --git a/get-started/index.html b/get-started/index.html index 3ae2af2af..d513f90ab 100644 --- a/get-started/index.html +++ b/get-started/index.html @@ -412,66 +412,66 @@

    A Basic T

    Let’s use a subset of the islands dataset available within great_tables.data:

    -
    +
    from great_tables import GT, md, html
     from great_tables.data import islands
     
     islands_mini = islands.head(10)

    The islands data is a simple Pandas DataFrame with 2 columns and that’ll serve as a great start. Speaking of which, the main entry point into the Great Tables API is the GT class. Let’s use that to make a presentable table:

    -
    +
    # Create a display table showing ten of the largest islands in the world
     gt_tbl = GT(islands_mini)
     
     # Show the output table
     gt_tbl
    -
    +

    @@ -537,7 +537,7 @@

    A Basic T

    Polars DataFrame support

    GT accepts both Pandas and Polars DataFrames. You can pass a Polars DataFrame to GT, or use its DataFrame.style property.

    -
    +
    import polars as pl
     
     df_polars = pl.from_pandas(islands_mini)
    @@ -548,52 +548,52 @@ 

    Polars# Approach 2: Polars style property ---- df_polars.style

    -
    +

    @@ -671,7 +671,7 @@

    Polars

    Some Beautiful Examples

    In the following pages we’ll use Great Tables to turn DataFrames into beautiful tables, like the ones below.

    -
    +
    Show the Code
    from great_tables import GT, md, html
    @@ -695,52 +695,52 @@ 

    Some Beautiful Exa )

    -
    +

    @@ -818,7 +818,7 @@

    Some Beautiful Exa -
    +
    Show the Code
    from great_tables import GT, html
    @@ -846,52 +846,52 @@ 

    Some Beautiful Exa gt_airquality

    -
    +

    diff --git a/get-started/loc-selection.html b/get-started/loc-selection.html index ad8c205e8..e402ddcf8 100644 --- a/get-started/loc-selection.html +++ b/get-started/loc-selection.html @@ -397,54 +397,54 @@

    Location selection

    Great Tables uses the loc module to specify locations for styling in tab_style(). Some location specifiers also allow selecting specific columns and rows of data.

    For example, you might style a particular row name, group, column, or spanner label.

    The table below shows the different location specifiers, along with the types of column or row selection they allow.

    -
    +
    -
    +
    @@ -525,7 +525,7 @@

    Location selection

    Setting up data

    The examples below will use this small dataset to show selecting different locations, as well as specific rows and columns within a location (where supported).

    -
    +
    import polars as pl
     import polars.selectors as cs
     
    @@ -550,7 +550,7 @@ 

    Setting up data

    Simple locations

    Simple locations don’t take any arguments.

    For example, styling the title uses loc.title().

    -
    +
    (
         GT(pl_exibble)
         .tab_header("A title", "A subtitle")
    @@ -560,52 +560,52 @@ 

    Simple locations

    ) )
    -
    +
    @@ -653,7 +653,7 @@

    Simple locations

    Composite locations

    Composite locations target multiple simple locations.

    For example, loc.header() includes both loc.title() and loc.subtitle().

    -
    +
    (
         GT(pl_exibble)
         .tab_header("A title", "A subtitle")
    @@ -663,52 +663,52 @@ 

    Composite locations ) )

    -
    +
    @@ -755,7 +755,7 @@

    Composite locations

    Body columns and rows

    Use loc.body() to style specific cells in the table body.

    -
    +
    (
         GT(pl_exibble).tab_style(
             style.fill("yellow"),
    @@ -766,52 +766,52 @@ 

    Body columns and row ) )

    -
    +
    @@ -854,7 +854,7 @@

    Body columns and row

    Column labels

    Locations like loc.spanner_labels() and loc.column_labels() can select specific column and spanner labels.

    You can use name strings, index position, or polars selectors.

    -
    +
    GT(pl_exibble).tab_style(
         style.fill("yellow"),
         loc.column_labels(
    @@ -862,52 +862,52 @@ 

    Column labels

    ), )
    -
    +
    @@ -954,7 +954,7 @@

    Row and group namesby index
  • by polars expression
  • -
    +
    gt = GT(pl_exibble).tab_stub(
         rowname_col="char",
         groupname_col="group",
    @@ -962,52 +962,52 @@ 

    Row and group names gt.tab_style(style.fill("yellow"), loc.stub())

    -
    +

    @@ -1046,55 +1046,55 @@

    Row and group names -
    +
    gt.tab_style(style.fill("yellow"), loc.stub("banana"))
    -
    +

    @@ -1133,55 +1133,55 @@

    Row and group names -
    +
    gt.tab_style(style.fill("yellow"), loc.stub(["apricot", 2]))
    -
    +

    @@ -1224,58 +1224,58 @@

    Row and group namesGroups by name and position

    Note that for specifying row groups, the group corresponding to the group name or row number in the original data is used.

    For example, the code below styles the group corresponding to the row at index 1 (i.e. the second row) in the data.

    -
    +
    gt.tab_style(
         style.fill("yellow"),
         loc.row_groups(1),
     )
    -
    +
    @@ -1316,58 +1316,58 @@

    Groups by name

    Since the second row (starting with “banana”) is in “grp_a”, that is the group that gets styled.

    This means you can use a polars expression to select groups:

    -
    +
    gt.tab_style(
         style.fill("yellow"),
         loc.row_groups(pl.col("group") == "grp_b"),
     )
    -
    +

    @@ -1407,58 +1407,58 @@

    Groups by name

    You can also specify group names using a string (or list of strings).

    -
    +
    gt.tab_style(
         style.fill("yellow"),
         loc.row_groups("grp_b"),
     )
    -
    +

    diff --git a/get-started/nanoplots.html b/get-started/nanoplots.html index fd804578e..b48137805 100644 --- a/get-started/nanoplots.html +++ b/get-started/nanoplots.html @@ -415,7 +415,7 @@

    Nanoplots

    A simple line-based nanoplot

    Let’s make some simple plots with a Polars DataFrame. Here we are using lists to define data values for each cell in the numbers column. The fmt_nanoplot() method understands that these are input values for a line plot (the default type of nanoplot).

    -
    +
    from great_tables import GT
     import polars as pl
     
    @@ -433,52 +433,52 @@ 

    A simple line GT(random_numbers_df).fmt_nanoplot(columns="numbers")

    -
    +
    @@ -541,55 +541,55 @@

    A simple line

    The reference line and the reference area

    You can insert two additional things which may be useful: a reference line and a reference area. You can define them either through literal values or via keywords (these are: "mean", "median", "min", "max", "q1", "q3", "first", or "last"). Here’s a reference line that corresponds to the mean data value of each nanoplot:

    -
    +
    GT(random_numbers_df).fmt_nanoplot(columns="numbers", reference_line="mean")
    -
    +

    @@ -627,55 +627,55 @@

    This example uses a reference area that bounds the minimum value to the median value:

    -
    +
    GT(random_numbers_df).fmt_nanoplot(columns="numbers", reference_area=["min", "median"])
    -
    +

    @@ -717,55 +717,55 @@

    Using autoscale= to have a common y-axis scale across plots

    There are lots of options. Like, if you want to ensure that the scale is shared across all of the nanoplots (so you can better get a sense of overall magnitude), you can set autoscale= to True:

    -
    +
    GT(random_numbers_df).fmt_nanoplot(columns="numbers", autoscale=True)
    -
    +

    @@ -807,7 +807,7 @@

    Using the nanoplot_options() helper function

    There are many options for customization. You can radically change the look of a collection of nanoplots with the nanoplot_options() helper function. With that function, you invoke it in the options= argument of fmt_nanoplot(). You can modify the sizes and colors of different elements, decide which elements are even present, and much more! Here’s an example where a line-based nanoplot retains all of its elements, but the overall appearance is greatly altered.

    -
    +
    from great_tables import nanoplot_options
     
     (
    @@ -828,52 +828,52 @@ 

    ) )

    -
    +
    @@ -915,55 +915,55 @@

    Making nanoplots with bars using plot_type="bar"

    We don’t just support line plots in fmt_nanoplot(), we also have the option to show bar plots. The only thing you need to change is the value of plot_type= argument to "bar":

    -
    +
    GT(random_numbers_df).fmt_nanoplot(columns="numbers", plot_type="bar")
    -
    +
    @@ -1002,7 +1002,7 @@

    still allows us to supply a reference line and a reference area with reference_line= and reference_area=. The autoscale= option works here as well. We also have a set of options just for bar plots available inside nanoplot_options(). Here’s an example where we use all of the aforementioned customization possibilities:

    -
    +
    (
         GT(random_numbers_df)
         .fmt_nanoplot(
    @@ -1025,52 +1025,52 @@ 

    ) )

    -
    +

    @@ -1111,7 +1111,7 @@

    Horizontal bar and line plots

    Single-value bar plots, running in the horizontal direction, can be made by simply invoking fmt_nanoplot() on a column of numeric values. These plots are meant for comparison across rows so the method automatically scales the horizontal bars to facilitate this type of display. Here’s a simple example that uses plot_type="bar" on the numbers column that contains a single numeric value in every cell.

    -
    +
    single_vals_df = pl.DataFrame(
         {
             "example": ["Row " + str(x) for x in range(1, 5)],
    @@ -1121,52 +1121,52 @@ 

    Horizontal b GT(single_vals_df).fmt_nanoplot(columns="numbers", plot_type="bar")

    -
    +
    @@ -1204,55 +1204,55 @@

    Horizontal b

    This, interestingly enough, works with the "line" type of nanoplot. The result is akin to a lollipop plot:

    -
    +
    GT(single_vals_df).fmt_nanoplot(columns="numbers")
    -
    +

    @@ -1294,7 +1294,7 @@

    Horizontal b

    Line plots with paired x and y values

    Aside from a single stream of y values, we can plot pairs of x and y values. This works only for the "line" type of plot. We can set up a column of Polars struct values in a DataFrame to have this input data prepared for fmt_nanoplot(). Notice that the dictionary values in the enclosed list must have the "x" and "y" keys. Further to this, the list lengths for each of "x" and "y" must match (i.e., to make valid pairs of x and y).

    -
    +
    weather_2 = pl.DataFrame(
         {
             "station": ["Station " + str(x) for x in range(1, 4)],
    @@ -1443,7 +1443,7 @@ 

    Line │ Station 1 ┆ {[6.1, 8.0, … 15.3],[24.2, 28.… │ │ Station 2 ┆ {[7.1, 8.2, … 14.2],[18.2, 18.… │ │ Station 3 ┆ {[6.3, 7.1, … 16.42],[15.2, 17… │ -└───────────┴─────────────────────────────────┘, _body=<great_tables._gt_data.Body object at 0x7f6410303010>, _boxhead=Boxhead([ColInfo(var='station', type=<ColInfoTypeEnum.default: 1>, column_label='station', column_align='left', column_width=None), ColInfo(var='temperatures', type=<ColInfoTypeEnum.default: 1>, column_label='temperatures', column_align='center', column_width=None)]), _stub=<great_tables._gt_data.Stub object at 0x7f64103933a0>, _spanners=Spanners([]), _heading=Heading(title=None, subtitle=None, preheader=None), _stubhead=None, _source_notes=[], _footnotes=[], _styles=[], _locale=<great_tables._gt_data.Locale object at 0x7f6410392500>, _formats=[<great_tables._gt_data.FormatInfo object at 0x7f6410393220>], _substitutions=[], _options=Options(table_id=OptionsInfo(scss=False, category='table', type='value', value=None), table_caption=OptionsInfo(scss=False, category='table', type='value', value=None), table_width=OptionsInfo(scss=True, category='table', type='px', value='auto'), table_layout=OptionsInfo(scss=True, category='table', type='value', value='fixed'), table_margin_left=OptionsInfo(scss=True, category='table', type='px', value='auto'), table_margin_right=OptionsInfo(scss=True, category='table', type='px', value='auto'), table_background_color=OptionsInfo(scss=True, category='table', type='value', value='#FFFFFF'), table_additional_css=OptionsInfo(scss=False, category='table', type='values', value=[]), table_font_names=OptionsInfo(scss=False, category='table', type='values', value=['-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', 'Fira Sans', 'Droid Sans', 'Arial', 'sans-serif']), table_font_size=OptionsInfo(scss=True, category='table', type='px', value='16px'), table_font_weight=OptionsInfo(scss=True, category='table', type='value', value='normal'), table_font_style=OptionsInfo(scss=True, category='table', type='value', value='normal'), table_font_color=OptionsInfo(scss=True, category='table', type='value', value='#333333'), table_font_color_light=OptionsInfo(scss=True, category='table', type='value', value='#FFFFFF'), table_border_top_include=OptionsInfo(scss=False, category='table', type='boolean', value=True), table_border_top_style=OptionsInfo(scss=True, category='table', type='value', value='solid'), table_border_top_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_top_color=OptionsInfo(scss=True, category='table', type='value', value='#A8A8A8'), table_border_right_style=OptionsInfo(scss=True, category='table', type='value', value='none'), table_border_right_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_right_color=OptionsInfo(scss=True, category='table', type='value', value='#D3D3D3'), table_border_bottom_include=OptionsInfo(scss=False, category='table', type='boolean', value=True), table_border_bottom_style=OptionsInfo(scss=True, category='table', type='value', value='solid'), table_border_bottom_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_bottom_color=OptionsInfo(scss=True, category='table', type='value', value='#A8A8A8'), table_border_left_style=OptionsInfo(scss=True, category='table', type='value', value='none'), table_border_left_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_left_color=OptionsInfo(scss=True, category='table', type='value', value='#D3D3D3'), heading_background_color=OptionsInfo(scss=True, category='heading', type='value', value=None), heading_align=OptionsInfo(scss=True, category='heading', type='value', value='center'), heading_title_font_size=OptionsInfo(scss=True, category='heading', type='px', value='125%'), heading_title_font_weight=OptionsInfo(scss=True, category='heading', type='value', value='initial'), heading_subtitle_font_size=OptionsInfo(scss=True, category='heading', type='px', value='85%'), heading_subtitle_font_weight=OptionsInfo(scss=True, category='heading', type='value', value='initial'), heading_padding=OptionsInfo(scss=True, category='heading', type='px', value='4px'), heading_padding_horizontal=OptionsInfo(scss=True, category='heading', type='px', value='5px'), heading_border_bottom_style=OptionsInfo(scss=True, category='heading', type='value', value='solid'), heading_border_bottom_width=OptionsInfo(scss=True, category='heading', type='px', value='2px'), heading_border_bottom_color=OptionsInfo(scss=True, category='heading', type='value', value='#D3D3D3'), heading_border_lr_style=OptionsInfo(scss=True, category='heading', type='value', value='none'), heading_border_lr_width=OptionsInfo(scss=True, category='heading', type='px', value='1px'), heading_border_lr_color=OptionsInfo(scss=True, category='heading', type='value', value='#D3D3D3'), column_labels_background_color=OptionsInfo(scss=True, category='column_labels', type='value', value=None), column_labels_font_size=OptionsInfo(scss=True, category='column_labels', type='px', value='100%'), column_labels_font_weight=OptionsInfo(scss=True, category='column_labels', type='value', value='normal'), column_labels_text_transform=OptionsInfo(scss=True, category='column_labels', type='value', value='inherit'), column_labels_padding=OptionsInfo(scss=True, category='column_labels', type='px', value='5px'), column_labels_padding_horizontal=OptionsInfo(scss=True, category='column_labels', type='px', value='5px'), column_labels_vlines_style=OptionsInfo(scss=True, category='table_body', type='value', value='none'), column_labels_vlines_width=OptionsInfo(scss=True, category='table_body', type='px', value='1px'), column_labels_vlines_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), column_labels_border_top_style=OptionsInfo(scss=True, category='column_labels', type='value', value='solid'), column_labels_border_top_width=OptionsInfo(scss=True, category='column_labels', type='px', value='2px'), column_labels_border_top_color=OptionsInfo(scss=True, category='column_labels', type='value', value='#D3D3D3'), column_labels_border_bottom_style=OptionsInfo(scss=True, category='column_labels', type='value', value='solid'), column_labels_border_bottom_width=OptionsInfo(scss=True, category='column_labels', type='px', value='2px'), column_labels_border_bottom_color=OptionsInfo(scss=True, category='column_labels', type='value', value='#D3D3D3'), column_labels_border_lr_style=OptionsInfo(scss=True, category='column_labels', type='value', value='none'), column_labels_border_lr_width=OptionsInfo(scss=True, category='column_labels', type='px', value='1px'), column_labels_border_lr_color=OptionsInfo(scss=True, category='column_labels', type='value', value='#D3D3D3'), column_labels_hidden=OptionsInfo(scss=False, category='column_labels', type='boolean', value=False), row_group_background_color=OptionsInfo(scss=True, category='row_group', type='value', value=None), row_group_font_size=OptionsInfo(scss=True, category='row_group', type='px', value='100%'), row_group_font_weight=OptionsInfo(scss=True, category='row_group', type='value', value='initial'), row_group_text_transform=OptionsInfo(scss=True, category='row_group', type='value', value='inherit'), row_group_padding=OptionsInfo(scss=True, category='row_group', type='px', value='8px'), row_group_padding_horizontal=OptionsInfo(scss=True, category='row_group', type='px', value='5px'), row_group_border_top_style=OptionsInfo(scss=True, category='row_group', type='value', value='solid'), row_group_border_top_width=OptionsInfo(scss=True, category='row_group', type='px', value='2px'), row_group_border_top_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_border_right_style=OptionsInfo(scss=True, category='row_group', type='value', value='none'), row_group_border_right_width=OptionsInfo(scss=True, category='row_group', type='px', value='1px'), row_group_border_right_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_border_bottom_style=OptionsInfo(scss=True, category='row_group', type='value', value='solid'), row_group_border_bottom_width=OptionsInfo(scss=True, category='row_group', type='px', value='2px'), row_group_border_bottom_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_border_left_style=OptionsInfo(scss=True, category='row_group', type='value', value='none'), row_group_border_left_width=OptionsInfo(scss=True, category='row_group', type='px', value='1px'), row_group_border_left_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_as_column=OptionsInfo(scss=False, category='row_group', type='boolean', value=False), table_body_hlines_style=OptionsInfo(scss=True, category='table_body', type='value', value='solid'), table_body_hlines_width=OptionsInfo(scss=True, category='table_body', type='px', value='1px'), table_body_hlines_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), table_body_vlines_style=OptionsInfo(scss=True, category='table_body', type='value', value='none'), table_body_vlines_width=OptionsInfo(scss=True, category='table_body', type='px', value='1px'), table_body_vlines_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), table_body_border_top_style=OptionsInfo(scss=True, category='table_body', type='value', value='solid'), table_body_border_top_width=OptionsInfo(scss=True, category='table_body', type='px', value='2px'), table_body_border_top_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), table_body_border_bottom_style=OptionsInfo(scss=True, category='table_body', type='value', value='solid'), table_body_border_bottom_width=OptionsInfo(scss=True, category='table_body', type='px', value='2px'), table_body_border_bottom_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), data_row_padding=OptionsInfo(scss=True, category='data_row', type='px', value='8px'), data_row_padding_horizontal=OptionsInfo(scss=True, category='data_row', type='px', value='5px'), stub_background_color=OptionsInfo(scss=True, category='stub', type='value', value=None), stub_font_size=OptionsInfo(scss=True, category='stub', type='px', value='100%'), stub_font_weight=OptionsInfo(scss=True, category='stub', type='value', value='initial'), stub_text_transform=OptionsInfo(scss=True, category='stub', type='value', value='inherit'), stub_border_style=OptionsInfo(scss=True, category='stub', type='value', value='solid'), stub_border_width=OptionsInfo(scss=True, category='stub', type='px', value='2px'), stub_border_color=OptionsInfo(scss=True, category='stub', type='value', value='#D3D3D3'), stub_row_group_background_color=OptionsInfo(scss=True, category='stub', type='value', value=None), stub_row_group_font_size=OptionsInfo(scss=True, category='stub', type='px', value='100%'), stub_row_group_font_weight=OptionsInfo(scss=True, category='stub', type='value', value='initial'), stub_row_group_text_transform=OptionsInfo(scss=True, category='stub', type='value', value='inherit'), stub_row_group_border_style=OptionsInfo(scss=True, category='stub', type='value', value='solid'), stub_row_group_border_width=OptionsInfo(scss=True, category='stub', type='px', value='2px'), stub_row_group_border_color=OptionsInfo(scss=True, category='stub', type='value', value='#D3D3D3'), source_notes_padding=OptionsInfo(scss=True, category='source_notes', type='px', value='4px'), source_notes_padding_horizontal=OptionsInfo(scss=True, category='source_notes', type='px', value='5px'), source_notes_background_color=OptionsInfo(scss=True, category='source_notes', type='value', value=None), source_notes_font_size=OptionsInfo(scss=True, category='source_notes', type='px', value='90%'), source_notes_border_bottom_style=OptionsInfo(scss=True, category='source_notes', type='value', value='none'), source_notes_border_bottom_width=OptionsInfo(scss=True, category='source_notes', type='px', value='2px'), source_notes_border_bottom_color=OptionsInfo(scss=True, category='source_notes', type='value', value='#D3D3D3'), source_notes_border_lr_style=OptionsInfo(scss=True, category='source_notes', type='value', value='none'), source_notes_border_lr_width=OptionsInfo(scss=True, category='source_notes', type='px', value='2px'), source_notes_border_lr_color=OptionsInfo(scss=True, category='source_notes', type='value', value='#D3D3D3'), source_notes_multiline=OptionsInfo(scss=False, category='source_notes', type='boolean', value=True), source_notes_sep=OptionsInfo(scss=False, category='source_notes', type='value', value=' '), row_striping_background_color=OptionsInfo(scss=True, category='row', type='value', value='rgba(128,128,128,0.05)'), row_striping_include_stub=OptionsInfo(scss=False, category='row', type='boolean', value=False), row_striping_include_table_body=OptionsInfo(scss=False, category='row', type='boolean', value=False), container_width=OptionsInfo(scss=False, category='container', type='px', value='auto'), container_height=OptionsInfo(scss=False, category='container', type='px', value='auto'), container_padding_x=OptionsInfo(scss=False, category='container', type='px', value='0px'), container_padding_y=OptionsInfo(scss=False, category='container', type='px', value='10px'), container_overflow_x=OptionsInfo(scss=False, category='container', type='overflow', value='auto'), container_overflow_y=OptionsInfo(scss=False, category='container', type='overflow', value='auto'), quarto_disable_processing=OptionsInfo(scss=False, category='quarto', type='logical', value=False), quarto_use_bootstrap=OptionsInfo(scss=False, category='quarto', type='logical', value=False)), _has_built=False)

    +└───────────┴─────────────────────────────────┘, _body=<great_tables._gt_data.Body object at 0x7f6e3501c3d0>, _boxhead=Boxhead([ColInfo(var='station', type=<ColInfoTypeEnum.default: 1>, column_label='station', column_align='left', column_width=None), ColInfo(var='temperatures', type=<ColInfoTypeEnum.default: 1>, column_label='temperatures', column_align='center', column_width=None)]), _stub=<great_tables._gt_data.Stub object at 0x7f6df809ee30>, _spanners=Spanners([]), _heading=Heading(title=None, subtitle=None, preheader=None), _stubhead=None, _source_notes=[], _footnotes=[], _styles=[], _locale=<great_tables._gt_data.Locale object at 0x7f6df809d6c0>, _formats=[<great_tables._gt_data.FormatInfo object at 0x7f6df80ca800>], _substitutions=[], _options=Options(table_id=OptionsInfo(scss=False, category='table', type='value', value=None), table_caption=OptionsInfo(scss=False, category='table', type='value', value=None), table_width=OptionsInfo(scss=True, category='table', type='px', value='auto'), table_layout=OptionsInfo(scss=True, category='table', type='value', value='fixed'), table_margin_left=OptionsInfo(scss=True, category='table', type='px', value='auto'), table_margin_right=OptionsInfo(scss=True, category='table', type='px', value='auto'), table_background_color=OptionsInfo(scss=True, category='table', type='value', value='#FFFFFF'), table_additional_css=OptionsInfo(scss=False, category='table', type='values', value=[]), table_font_names=OptionsInfo(scss=False, category='table', type='values', value=['-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', 'Fira Sans', 'Droid Sans', 'Arial', 'sans-serif']), table_font_size=OptionsInfo(scss=True, category='table', type='px', value='16px'), table_font_weight=OptionsInfo(scss=True, category='table', type='value', value='normal'), table_font_style=OptionsInfo(scss=True, category='table', type='value', value='normal'), table_font_color=OptionsInfo(scss=True, category='table', type='value', value='#333333'), table_font_color_light=OptionsInfo(scss=True, category='table', type='value', value='#FFFFFF'), table_border_top_include=OptionsInfo(scss=False, category='table', type='boolean', value=True), table_border_top_style=OptionsInfo(scss=True, category='table', type='value', value='solid'), table_border_top_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_top_color=OptionsInfo(scss=True, category='table', type='value', value='#A8A8A8'), table_border_right_style=OptionsInfo(scss=True, category='table', type='value', value='none'), table_border_right_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_right_color=OptionsInfo(scss=True, category='table', type='value', value='#D3D3D3'), table_border_bottom_include=OptionsInfo(scss=False, category='table', type='boolean', value=True), table_border_bottom_style=OptionsInfo(scss=True, category='table', type='value', value='solid'), table_border_bottom_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_bottom_color=OptionsInfo(scss=True, category='table', type='value', value='#A8A8A8'), table_border_left_style=OptionsInfo(scss=True, category='table', type='value', value='none'), table_border_left_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_left_color=OptionsInfo(scss=True, category='table', type='value', value='#D3D3D3'), heading_background_color=OptionsInfo(scss=True, category='heading', type='value', value=None), heading_align=OptionsInfo(scss=True, category='heading', type='value', value='center'), heading_title_font_size=OptionsInfo(scss=True, category='heading', type='px', value='125%'), heading_title_font_weight=OptionsInfo(scss=True, category='heading', type='value', value='initial'), heading_subtitle_font_size=OptionsInfo(scss=True, category='heading', type='px', value='85%'), heading_subtitle_font_weight=OptionsInfo(scss=True, category='heading', type='value', value='initial'), heading_padding=OptionsInfo(scss=True, category='heading', type='px', value='4px'), heading_padding_horizontal=OptionsInfo(scss=True, category='heading', type='px', value='5px'), heading_border_bottom_style=OptionsInfo(scss=True, category='heading', type='value', value='solid'), heading_border_bottom_width=OptionsInfo(scss=True, category='heading', type='px', value='2px'), heading_border_bottom_color=OptionsInfo(scss=True, category='heading', type='value', value='#D3D3D3'), heading_border_lr_style=OptionsInfo(scss=True, category='heading', type='value', value='none'), heading_border_lr_width=OptionsInfo(scss=True, category='heading', type='px', value='1px'), heading_border_lr_color=OptionsInfo(scss=True, category='heading', type='value', value='#D3D3D3'), column_labels_background_color=OptionsInfo(scss=True, category='column_labels', type='value', value=None), column_labels_font_size=OptionsInfo(scss=True, category='column_labels', type='px', value='100%'), column_labels_font_weight=OptionsInfo(scss=True, category='column_labels', type='value', value='normal'), column_labels_text_transform=OptionsInfo(scss=True, category='column_labels', type='value', value='inherit'), column_labels_padding=OptionsInfo(scss=True, category='column_labels', type='px', value='5px'), column_labels_padding_horizontal=OptionsInfo(scss=True, category='column_labels', type='px', value='5px'), column_labels_vlines_style=OptionsInfo(scss=True, category='table_body', type='value', value='none'), column_labels_vlines_width=OptionsInfo(scss=True, category='table_body', type='px', value='1px'), column_labels_vlines_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), column_labels_border_top_style=OptionsInfo(scss=True, category='column_labels', type='value', value='solid'), column_labels_border_top_width=OptionsInfo(scss=True, category='column_labels', type='px', value='2px'), column_labels_border_top_color=OptionsInfo(scss=True, category='column_labels', type='value', value='#D3D3D3'), column_labels_border_bottom_style=OptionsInfo(scss=True, category='column_labels', type='value', value='solid'), column_labels_border_bottom_width=OptionsInfo(scss=True, category='column_labels', type='px', value='2px'), column_labels_border_bottom_color=OptionsInfo(scss=True, category='column_labels', type='value', value='#D3D3D3'), column_labels_border_lr_style=OptionsInfo(scss=True, category='column_labels', type='value', value='none'), column_labels_border_lr_width=OptionsInfo(scss=True, category='column_labels', type='px', value='1px'), column_labels_border_lr_color=OptionsInfo(scss=True, category='column_labels', type='value', value='#D3D3D3'), column_labels_hidden=OptionsInfo(scss=False, category='column_labels', type='boolean', value=False), row_group_background_color=OptionsInfo(scss=True, category='row_group', type='value', value=None), row_group_font_size=OptionsInfo(scss=True, category='row_group', type='px', value='100%'), row_group_font_weight=OptionsInfo(scss=True, category='row_group', type='value', value='initial'), row_group_text_transform=OptionsInfo(scss=True, category='row_group', type='value', value='inherit'), row_group_padding=OptionsInfo(scss=True, category='row_group', type='px', value='8px'), row_group_padding_horizontal=OptionsInfo(scss=True, category='row_group', type='px', value='5px'), row_group_border_top_style=OptionsInfo(scss=True, category='row_group', type='value', value='solid'), row_group_border_top_width=OptionsInfo(scss=True, category='row_group', type='px', value='2px'), row_group_border_top_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_border_right_style=OptionsInfo(scss=True, category='row_group', type='value', value='none'), row_group_border_right_width=OptionsInfo(scss=True, category='row_group', type='px', value='1px'), row_group_border_right_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_border_bottom_style=OptionsInfo(scss=True, category='row_group', type='value', value='solid'), row_group_border_bottom_width=OptionsInfo(scss=True, category='row_group', type='px', value='2px'), row_group_border_bottom_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_border_left_style=OptionsInfo(scss=True, category='row_group', type='value', value='none'), row_group_border_left_width=OptionsInfo(scss=True, category='row_group', type='px', value='1px'), row_group_border_left_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_as_column=OptionsInfo(scss=False, category='row_group', type='boolean', value=False), table_body_hlines_style=OptionsInfo(scss=True, category='table_body', type='value', value='solid'), table_body_hlines_width=OptionsInfo(scss=True, category='table_body', type='px', value='1px'), table_body_hlines_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), table_body_vlines_style=OptionsInfo(scss=True, category='table_body', type='value', value='none'), table_body_vlines_width=OptionsInfo(scss=True, category='table_body', type='px', value='1px'), table_body_vlines_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), table_body_border_top_style=OptionsInfo(scss=True, category='table_body', type='value', value='solid'), table_body_border_top_width=OptionsInfo(scss=True, category='table_body', type='px', value='2px'), table_body_border_top_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), table_body_border_bottom_style=OptionsInfo(scss=True, category='table_body', type='value', value='solid'), table_body_border_bottom_width=OptionsInfo(scss=True, category='table_body', type='px', value='2px'), table_body_border_bottom_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), data_row_padding=OptionsInfo(scss=True, category='data_row', type='px', value='8px'), data_row_padding_horizontal=OptionsInfo(scss=True, category='data_row', type='px', value='5px'), stub_background_color=OptionsInfo(scss=True, category='stub', type='value', value=None), stub_font_size=OptionsInfo(scss=True, category='stub', type='px', value='100%'), stub_font_weight=OptionsInfo(scss=True, category='stub', type='value', value='initial'), stub_text_transform=OptionsInfo(scss=True, category='stub', type='value', value='inherit'), stub_border_style=OptionsInfo(scss=True, category='stub', type='value', value='solid'), stub_border_width=OptionsInfo(scss=True, category='stub', type='px', value='2px'), stub_border_color=OptionsInfo(scss=True, category='stub', type='value', value='#D3D3D3'), stub_row_group_background_color=OptionsInfo(scss=True, category='stub', type='value', value=None), stub_row_group_font_size=OptionsInfo(scss=True, category='stub', type='px', value='100%'), stub_row_group_font_weight=OptionsInfo(scss=True, category='stub', type='value', value='initial'), stub_row_group_text_transform=OptionsInfo(scss=True, category='stub', type='value', value='inherit'), stub_row_group_border_style=OptionsInfo(scss=True, category='stub', type='value', value='solid'), stub_row_group_border_width=OptionsInfo(scss=True, category='stub', type='px', value='2px'), stub_row_group_border_color=OptionsInfo(scss=True, category='stub', type='value', value='#D3D3D3'), source_notes_padding=OptionsInfo(scss=True, category='source_notes', type='px', value='4px'), source_notes_padding_horizontal=OptionsInfo(scss=True, category='source_notes', type='px', value='5px'), source_notes_background_color=OptionsInfo(scss=True, category='source_notes', type='value', value=None), source_notes_font_size=OptionsInfo(scss=True, category='source_notes', type='px', value='90%'), source_notes_border_bottom_style=OptionsInfo(scss=True, category='source_notes', type='value', value='none'), source_notes_border_bottom_width=OptionsInfo(scss=True, category='source_notes', type='px', value='2px'), source_notes_border_bottom_color=OptionsInfo(scss=True, category='source_notes', type='value', value='#D3D3D3'), source_notes_border_lr_style=OptionsInfo(scss=True, category='source_notes', type='value', value='none'), source_notes_border_lr_width=OptionsInfo(scss=True, category='source_notes', type='px', value='2px'), source_notes_border_lr_color=OptionsInfo(scss=True, category='source_notes', type='value', value='#D3D3D3'), source_notes_multiline=OptionsInfo(scss=False, category='source_notes', type='boolean', value=True), source_notes_sep=OptionsInfo(scss=False, category='source_notes', type='value', value=' '), row_striping_background_color=OptionsInfo(scss=True, category='row', type='value', value='rgba(128,128,128,0.05)'), row_striping_include_stub=OptionsInfo(scss=False, category='row', type='boolean', value=False), row_striping_include_table_body=OptionsInfo(scss=False, category='row', type='boolean', value=False), container_width=OptionsInfo(scss=False, category='container', type='px', value='auto'), container_height=OptionsInfo(scss=False, category='container', type='px', value='auto'), container_padding_x=OptionsInfo(scss=False, category='container', type='px', value='0px'), container_padding_y=OptionsInfo(scss=False, category='container', type='px', value='10px'), container_overflow_x=OptionsInfo(scss=False, category='container', type='overflow', value='auto'), container_overflow_y=OptionsInfo(scss=False, category='container', type='overflow', value='auto'), quarto_disable_processing=OptionsInfo(scss=False, category='quarto', type='logical', value=False), quarto_use_bootstrap=OptionsInfo(scss=False, category='quarto', type='logical', value=False)), _has_built=False)

    The options for removing the data area and the data line (though the corresponding show_* arguments of nanoplot_options()) make the finalized nanoplots look somewhat like scatter plots.

    diff --git a/get-started/row-selection.html b/get-started/row-selection.html index f2cbeee1c..90232dc32 100644 --- a/get-started/row-selection.html +++ b/get-started/row-selection.html @@ -398,7 +398,7 @@

    Row Selection

  • a function that takes a DataFrame and returns a boolean Series.
  • The following sections will use a subset of the exibble data, to demonstrate these options.

    -
    +
    from great_tables import GT, exibble, loc, style
     
     lil_exibble = exibble[["num", "char", "currency"]].head(3)
    @@ -407,55 +407,55 @@ 

    Row Selection

    Using integers

    Use a single integer, or a list of integers, to select rows by position.

    -
    +
    gt_ex.fmt_currency("currency", rows=0, decimals=1)
    -
    +

    @@ -494,55 +494,55 @@

    Using integers

    Notice that a dollar sign ($) was only added to the first row (index 0 in python).

    Indexing works the same as selecting items from a python list. This negative integers select relative to the final row.

    -
    +
    gt_ex.fmt_currency("currency", rows=[0, -1], decimals=1)
    -
    +
    @@ -584,59 +584,59 @@

    Using integers

    Using polars expressions

    The rows= argument accepts polars expressions, which return a boolean Series, indicating which rows to operate on.

    For example, the code below only formats the num column, but only when currency is less than 40.

    -
    +
    import polars as pl
     
     gt_polars = GT(pl.from_pandas(lil_exibble))
     
     gt_polars.fmt_integer("num", rows=pl.col("currency") < 40)
    -
    +
    @@ -674,7 +674,7 @@

    Using polars expr

    Here’s a more realistic example, which highlights the row with the highest value for currency.

    -
    +
    import polars.selectors as cs
     
     gt_polars.tab_style(
    @@ -685,52 +685,52 @@ 

    Using polars expr ) )

    -
    +

    @@ -772,55 +772,55 @@

    Using polars expr

    Using a function

    Since libraries like pandas don’t have lazy expressions, the rows= argument also accepts a function for selecting rows. The function should take a DataFrame and return a boolean series.

    Here’s the same example as the previous polars section, but with pandas data, and a lamba for selecting rows.

    -
    +
    gt_ex.fmt_integer("num", rows=lambda D: D["currency"] < 40)
    -
    +
    @@ -858,7 +858,7 @@

    Using a function

    Here’s the styling example from the previous polars section.

    -
    +
    import polars.selectors as cs
     
     gt_ex.tab_style(
    @@ -869,52 +869,52 @@ 

    Using a function

    ) )
    -
    +
    diff --git a/get-started/table-theme-options.html b/get-started/table-theme-options.html index e7da329ad..2bb6d710b 100644 --- a/get-started/table-theme-options.html +++ b/get-started/table-theme-options.html @@ -401,7 +401,7 @@

    Table Theme Options

    This page covers how to style and theme your table using GT.tab_options(), which is meant to quickly set a broad range of styles.

    We’ll use the basic GT object below for most examples, since it marks some of the table parts.

    -
    +
    from great_tables import GT, exibble
     
     gt_ex = (
    @@ -413,52 +413,52 @@ 

    Table Theme Options

    gt_ex
    -
    +
    @@ -557,7 +557,7 @@

    Table Theme Options

    Table option parts

    As the graph above showed, tables are made of many parts—such as the heading, column labels, and stub. .tab_options() organizes options based on table part.

    The code below illustrates the table parts .tab_options() can target, by setting the background color for various parts.

    -
    +
    (
         gt_ex
         .tab_options(
    @@ -571,52 +571,52 @@ 

    Table option parts

    ) )
    -
    +
    @@ -750,59 +750,59 @@

    Findin

    Styling borders

    Many table parts support customizing border colors and style. This is shown below for column labels.

    -
    +
    gt_ex.tab_options(
         column_labels_border_top_color="blue",
         column_labels_border_top_style="solid",
         column_labels_border_top_width="5px"
     )
    -
    +

    @@ -900,57 +900,57 @@

    Styling borders

    Styling background color

    -
    +
    gt_ex.tab_options(
         heading_background_color="purple"
     )
    -
    +
    @@ -1050,59 +1050,59 @@

    Styling backgroun

    Styling body cells

    The table body can style the lines between individual cells. Use the hline and vline option types to specify cell line color, style, and width.

    For example, the code below changes horizontal lines (hline) between cells to be red, dashed lines.

    -
    +
    gt_ex.tab_options(
         table_body_hlines_color="red",
         table_body_hlines_style="dashed",
         table_body_hlines_width="4px",
     )
    -
    +
    @@ -1198,58 +1198,58 @@

    Styling body cells

    In order to define the vertical lines between cells, set vline styles. For example, the code below makes both horizontal and vertical lines between cells solid.

    -
    +
    gt_ex.tab_options(
         table_body_hlines_style="solid",
         table_body_vlines_style="solid",
     )
    -
    +
    @@ -1348,7 +1348,7 @@

    Styling body cells

    Set options across table parts

    Some options starting with table_ apply to all parts of the table. For example, fonts and background color apply everywhere.

    -
    +
    gt_ex.tab_options(
         table_background_color="green",
         table_font_color="darkblue",
    @@ -1356,52 +1356,52 @@ 

    Set options table_font_names="Times New Roman" )

    -
    +
    @@ -1497,58 +1497,58 @@

    Set options

    Options set across the whole table, can be overriden by styling a specific part.

    -
    +
    gt_ex.tab_options(
         table_background_color="orange",
         heading_background_color="pink"
     )
    -
    +

    @@ -1648,7 +1648,7 @@

    Set options

    A basic theme

    Based on the sections above, we can design an overall theme for a table.

    This requires setting a decent number of options, but makes a big difference when presenting a table! Below is a table with a simple, blue theme. (The code is hidden by default, but can be expanded to see all the options set).

    -
    +
    Code
    from great_tables import GT, exibble
    @@ -1695,52 +1695,52 @@ 

    A basic theme

    )
    -
    +
    diff --git a/get-started/table-theme-premade.html b/get-started/table-theme-premade.html index 40990000c..36fd82f79 100644 --- a/get-started/table-theme-premade.html +++ b/get-started/table-theme-premade.html @@ -400,7 +400,7 @@

    Premade Themes

  • The remaining GT.opt_*() methods: shortcuts for common uses of GT.tab_options().
  • We’ll use the basic GT object below for most examples, since it marks some of the table parts.

    -
    +
    from great_tables import GT, exibble, md
     
     lil_exibble = exibble.head(5)[["num", "char", "row", "group"]]
    @@ -420,52 +420,52 @@ 

    Premade Themes

    gt_ex
    -
    +
    @@ -535,55 +535,55 @@

    opt_styli

    Below are the first two premade styles. The first uses color="blue", and the second uses color="red".

    -
    +
    gt_ex.opt_stylize(style=1, color="blue")
    -
    +

    @@ -650,55 +650,55 @@

    opt_styli
    -
    +
    gt_ex.opt_stylize(style=2, color="red")
    -
    +

    @@ -777,52 +777,52 @@

    opt_styli
    1
    -
    +

    @@ -930,52 +930,52 @@

    opt_styli
    2
    -
    +

    @@ -1083,52 +1083,52 @@

    opt_styli
    3
    -
    +

    @@ -1236,52 +1236,52 @@

    opt_styli
    4
    -
    +

    @@ -1389,52 +1389,52 @@

    opt_styli
    5
    -
    +

    @@ -1542,52 +1542,52 @@

    opt_styli
    6
    -
    +

    @@ -1698,55 +1698,55 @@

    opt_*()This section shows the different GT.opt_*() methods available. They serve as convenience methods for common GT.tab_options() tasks.

    Align table header

    -
    +
    gt_ex.opt_align_table_header(align="left")
    -
    +

    @@ -1814,55 +1814,55 @@

    Align table header

    Make text ALL CAPS

    -
    +
    gt_ex.opt_all_caps()
    -
    +
    @@ -1930,55 +1930,55 @@

    Make text ALL CAPS

    Reduce or expand padding

    -
    +
    gt_ex.opt_vertical_padding(scale=0.3)
    -
    +
    @@ -2043,55 +2043,55 @@

    Reduce or expand -
    +
    gt_ex.opt_horizontal_padding(scale=3)
    -
    +

    @@ -2159,55 +2159,55 @@

    Reduce or expand

    Set table outline

    -
    +
    gt_ex.opt_table_outline()
    -
    +

    diff --git a/get-started/targeted-styles.html b/get-started/targeted-styles.html index 569bcd039..196271cec 100644 --- a/get-started/targeted-styles.html +++ b/get-started/targeted-styles.html @@ -409,7 +409,7 @@

    Styling the whole table

    Kitchen sink

    Below is a big example that shows all possible loc specifiers being used.

    -
    +
    from great_tables import GT, exibble, loc, style
     
     # https://colorbrewer2.org/#type=qualitative&scheme=Paired&n=12
    @@ -460,52 +460,52 @@ 

    Kitchen sink

    .tab_style(style.fill(next(c)), loc.stubhead()) )
    -
    +
    @@ -572,55 +572,55 @@

    Kitchen sink

    Body

    -
    +
    gt.tab_style(style.fill("yellow"), loc.body())
    -
    +
    @@ -687,7 +687,7 @@

    Body

    Column labels

    -
    +
    (
         gt
         .tab_style(style.fill("yellow"), loc.column_header())
    @@ -695,52 +695,52 @@ 

    Column labels

    .tab_style(style.fill("red"), loc.spanner_labels(ids=["spanner"])) )
    -
    +
    @@ -807,59 +807,59 @@

    Column labels

    @@ -926,7 +926,7 @@

    Header

    @@ -1049,7 +1049,7 @@

    Footer

    Stub

    -
    +
    (
         gt.tab_style(style.fill("yellow"), loc.stub())
         .tab_style(style.fill("blue"), loc.row_groups())
    @@ -1059,52 +1059,52 @@ 

    Stub

    ) )
    -
    +
    @@ -1171,55 +1171,55 @@

    Stub

    Stubhead

    -
    +
    gt.tab_style(style.fill("yellow"), loc.stubhead())
    -
    +
    diff --git a/reference/GT.as_latex.html b/reference/GT.as_latex.html index 29999f5bb..17ddae1e4 100644 --- a/reference/GT.as_latex.html +++ b/reference/GT.as_latex.html @@ -262,7 +262,7 @@

    Examples

    Let’s use a subset of the gtcars dataset to create a new table.

    -
    +
    from great_tables import GT
     from great_tables.data import gtcars
     import polars as pl
    @@ -284,52 +284,52 @@ 

    gt_tbl

    -
    +
    @@ -383,7 +383,7 @@

    Now we can return the table as string of LaTeX code using the as_latex() method.

    -
    +
    gt_tbl.as_latex()
    '\\begin{table}\n\\caption*{\n{\\large Data Listing from the gtcars Dataset} \\\\\n{\\small Only five rows from the dataset are shown here.}\n} \n\n\\fontsize{12.0pt}{14.4pt}\\selectfont\n\n\\begin{tabular*}{\\linewidth}{@{\\extracolsep{\\fill}}llr}\n\\toprule\nmfr & model & msrp \\\\ \n\\midrule\\addlinespace[2.5pt]\nFord & GT & \\$447,000.00 \\\\\nFerrari & 458 Speciale & \\$291,744.00 \\\\\nFerrari & 458 Spider & \\$263,553.00 \\\\\nFerrari & 458 Italia & \\$233,509.00 \\\\\nFerrari & 488 GTB & \\$245,400.00 \\\\\n\\bottomrule\n\\end{tabular*}\n\n\\end{table}\n'
    diff --git a/reference/GT.as_raw_html.html b/reference/GT.as_raw_html.html index 776e7bd9a..cb192546f 100644 --- a/reference/GT.as_raw_html.html +++ b/reference/GT.as_raw_html.html @@ -239,7 +239,7 @@

    Re

    Examples:

    Let’s use a subset of the gtcars dataset to create a new table.

    -
    +
    from great_tables import GT, md, style, loc
     from great_tables.data import gtcars
     import polars as pl
    @@ -271,52 +271,52 @@ 

    gt_tbl

    -
    +

    @@ -370,24 +370,24 @@

    Now we can return the table as an HTML string using the as_raw_html() method.

    -
    +
    gt_tbl.as_raw_html()
    -
    '<div id="tdmmfufxat" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">\n<style>\n#tdmmfufxat table {\n          font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen, Ubuntu, Cantarell, \'Helvetica Neue\', \'Fira Sans\', \'Droid Sans\', Arial, sans-serif;\n          -webkit-font-smoothing: antialiased;\n          -moz-osx-font-smoothing: grayscale;\n        }\n\n#tdmmfufxat thead, tbody, tfoot, tr, td, th { border-style: none; }\n tr { background-color: transparent; }\n#tdmmfufxat p { margin: 0; padding: 0; }\n #tdmmfufxat .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }\n #tdmmfufxat .gt_caption { padding-top: 4px; padding-bottom: 4px; }\n #tdmmfufxat .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }\n #tdmmfufxat .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-top-color: #FFFFFF; border-top-width: 0; }\n #tdmmfufxat .gt_heading { background-color: Azure; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\n #tdmmfufxat .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\n #tdmmfufxat .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\n #tdmmfufxat .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }\n #tdmmfufxat .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }\n #tdmmfufxat .gt_column_spanner_outer:first-child { padding-left: 0; }\n #tdmmfufxat .gt_column_spanner_outer:last-child { padding-right: 0; }\n #tdmmfufxat .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }\n #tdmmfufxat .gt_spanner_row { border-bottom-style: hidden; }\n #tdmmfufxat .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }\n #tdmmfufxat .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }\n #tdmmfufxat .gt_from_md> :first-child { margin-top: 0; }\n #tdmmfufxat .gt_from_md> :last-child { margin-bottom: 0; }\n #tdmmfufxat .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; margin: 10px; border-top-style: solid; border-top-width: 2px; border-top-color: Lavender; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }\n #tdmmfufxat .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; }\n #tdmmfufxat .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; vertical-align: top; }\n #tdmmfufxat .gt_row_group_first td { border-top-width: 2px; }\n #tdmmfufxat .gt_row_group_first th { border-top-width: 2px; }\n #tdmmfufxat .gt_striped { background-color: rgba(128,128,128,0.05); }\n #tdmmfufxat .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\n #tdmmfufxat .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }\n #tdmmfufxat .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }\n #tdmmfufxat .gt_left { text-align: left; }\n #tdmmfufxat .gt_center { text-align: center; }\n #tdmmfufxat .gt_right { text-align: right; font-variant-numeric: tabular-nums; }\n #tdmmfufxat .gt_font_normal { font-weight: normal; }\n #tdmmfufxat .gt_font_bold { font-weight: bold; }\n #tdmmfufxat .gt_font_italic { font-style: italic; }\n #tdmmfufxat .gt_super { font-size: 65%; }\n #tdmmfufxat .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }\n #tdmmfufxat .gt_asterisk { font-size: 100%; vertical-align: 0; }\n \n</style>\n<table class="gt_table" data-quarto-disable-processing="false" data-quarto-bootstrap="false">\n<thead>\n\n  <tr class="gt_heading">\n    <td colspan="3" class="gt_heading gt_title gt_font_normal">Data listing from <strong>gtcars</strong></td>\n  </tr>\n  <tr class="gt_heading">\n    <td colspan="3" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">gtcars is an R dataset</td>\n  </tr>\n<tr class="gt_col_headings">\n  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="mfr">mfr</th>\n  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="model">model</th>\n  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="msrp">msrp</th>\n</tr>\n</thead>\n<tbody class="gt_table_body">\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ford</td>\n    <td class="gt_row gt_left">GT</td>\n    <td class="gt_row gt_right">$447,000.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">458 Speciale</td>\n    <td class="gt_row gt_right">$291,744.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">458 Spider</td>\n    <td class="gt_row gt_right">$263,553.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">458 Italia</td>\n    <td class="gt_row gt_right">$233,509.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">488 GTB</td>\n    <td class="gt_row gt_right">$245,400.00</td>\n  </tr>\n</tbody>\n\n\n</table>\n\n</div>\n        '
    +
    '<div id="itnnuhefgh" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">\n<style>\n#itnnuhefgh table {\n          font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen, Ubuntu, Cantarell, \'Helvetica Neue\', \'Fira Sans\', \'Droid Sans\', Arial, sans-serif;\n          -webkit-font-smoothing: antialiased;\n          -moz-osx-font-smoothing: grayscale;\n        }\n\n#itnnuhefgh thead, tbody, tfoot, tr, td, th { border-style: none; }\n tr { background-color: transparent; }\n#itnnuhefgh p { margin: 0; padding: 0; }\n #itnnuhefgh .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }\n #itnnuhefgh .gt_caption { padding-top: 4px; padding-bottom: 4px; }\n #itnnuhefgh .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }\n #itnnuhefgh .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-top-color: #FFFFFF; border-top-width: 0; }\n #itnnuhefgh .gt_heading { background-color: Azure; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\n #itnnuhefgh .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\n #itnnuhefgh .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\n #itnnuhefgh .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }\n #itnnuhefgh .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }\n #itnnuhefgh .gt_column_spanner_outer:first-child { padding-left: 0; }\n #itnnuhefgh .gt_column_spanner_outer:last-child { padding-right: 0; }\n #itnnuhefgh .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }\n #itnnuhefgh .gt_spanner_row { border-bottom-style: hidden; }\n #itnnuhefgh .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }\n #itnnuhefgh .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }\n #itnnuhefgh .gt_from_md> :first-child { margin-top: 0; }\n #itnnuhefgh .gt_from_md> :last-child { margin-bottom: 0; }\n #itnnuhefgh .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; margin: 10px; border-top-style: solid; border-top-width: 2px; border-top-color: Lavender; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }\n #itnnuhefgh .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; }\n #itnnuhefgh .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; vertical-align: top; }\n #itnnuhefgh .gt_row_group_first td { border-top-width: 2px; }\n #itnnuhefgh .gt_row_group_first th { border-top-width: 2px; }\n #itnnuhefgh .gt_striped { background-color: rgba(128,128,128,0.05); }\n #itnnuhefgh .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\n #itnnuhefgh .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }\n #itnnuhefgh .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }\n #itnnuhefgh .gt_left { text-align: left; }\n #itnnuhefgh .gt_center { text-align: center; }\n #itnnuhefgh .gt_right { text-align: right; font-variant-numeric: tabular-nums; }\n #itnnuhefgh .gt_font_normal { font-weight: normal; }\n #itnnuhefgh .gt_font_bold { font-weight: bold; }\n #itnnuhefgh .gt_font_italic { font-style: italic; }\n #itnnuhefgh .gt_super { font-size: 65%; }\n #itnnuhefgh .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }\n #itnnuhefgh .gt_asterisk { font-size: 100%; vertical-align: 0; }\n \n</style>\n<table class="gt_table" data-quarto-disable-processing="false" data-quarto-bootstrap="false">\n<thead>\n\n  <tr class="gt_heading">\n    <td colspan="3" class="gt_heading gt_title gt_font_normal">Data listing from <strong>gtcars</strong></td>\n  </tr>\n  <tr class="gt_heading">\n    <td colspan="3" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">gtcars is an R dataset</td>\n  </tr>\n<tr class="gt_col_headings">\n  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="mfr">mfr</th>\n  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="model">model</th>\n  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="msrp">msrp</th>\n</tr>\n</thead>\n<tbody class="gt_table_body">\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ford</td>\n    <td class="gt_row gt_left">GT</td>\n    <td class="gt_row gt_right">$447,000.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">458 Speciale</td>\n    <td class="gt_row gt_right">$291,744.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">458 Spider</td>\n    <td class="gt_row gt_right">$263,553.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">458 Italia</td>\n    <td class="gt_row gt_right">$233,509.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">488 GTB</td>\n    <td class="gt_row gt_right">$245,400.00</td>\n  </tr>\n</tbody>\n\n\n</table>\n\n</div>\n        '

    The HTML string contains the HTML for the table. It has only the table so it’s not a complete HTML document but rather an HTML fragment. While this useful for embedding a table in an existing HTML document, you could also use the make_page=True argument to get a complete HTML page with the table contained within.

    -
    +
    gt_tbl.as_raw_html(make_page=True)
    -
    '<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8"/>\n</head>\n<body>\n<div id="ruypjqrsqh" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">\n<style>\n#ruypjqrsqh table {\n          font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen, Ubuntu, Cantarell, \'Helvetica Neue\', \'Fira Sans\', \'Droid Sans\', Arial, sans-serif;\n          -webkit-font-smoothing: antialiased;\n          -moz-osx-font-smoothing: grayscale;\n        }\n\n#ruypjqrsqh thead, tbody, tfoot, tr, td, th { border-style: none; }\n tr { background-color: transparent; }\n#ruypjqrsqh p { margin: 0; padding: 0; }\n #ruypjqrsqh .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }\n #ruypjqrsqh .gt_caption { padding-top: 4px; padding-bottom: 4px; }\n #ruypjqrsqh .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }\n #ruypjqrsqh .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-top-color: #FFFFFF; border-top-width: 0; }\n #ruypjqrsqh .gt_heading { background-color: Azure; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\n #ruypjqrsqh .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\n #ruypjqrsqh .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\n #ruypjqrsqh .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }\n #ruypjqrsqh .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }\n #ruypjqrsqh .gt_column_spanner_outer:first-child { padding-left: 0; }\n #ruypjqrsqh .gt_column_spanner_outer:last-child { padding-right: 0; }\n #ruypjqrsqh .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }\n #ruypjqrsqh .gt_spanner_row { border-bottom-style: hidden; }\n #ruypjqrsqh .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }\n #ruypjqrsqh .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }\n #ruypjqrsqh .gt_from_md> :first-child { margin-top: 0; }\n #ruypjqrsqh .gt_from_md> :last-child { margin-bottom: 0; }\n #ruypjqrsqh .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; margin: 10px; border-top-style: solid; border-top-width: 2px; border-top-color: Lavender; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }\n #ruypjqrsqh .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; }\n #ruypjqrsqh .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; vertical-align: top; }\n #ruypjqrsqh .gt_row_group_first td { border-top-width: 2px; }\n #ruypjqrsqh .gt_row_group_first th { border-top-width: 2px; }\n #ruypjqrsqh .gt_striped { background-color: rgba(128,128,128,0.05); }\n #ruypjqrsqh .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\n #ruypjqrsqh .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }\n #ruypjqrsqh .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }\n #ruypjqrsqh .gt_left { text-align: left; }\n #ruypjqrsqh .gt_center { text-align: center; }\n #ruypjqrsqh .gt_right { text-align: right; font-variant-numeric: tabular-nums; }\n #ruypjqrsqh .gt_font_normal { font-weight: normal; }\n #ruypjqrsqh .gt_font_bold { font-weight: bold; }\n #ruypjqrsqh .gt_font_italic { font-style: italic; }\n #ruypjqrsqh .gt_super { font-size: 65%; }\n #ruypjqrsqh .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }\n #ruypjqrsqh .gt_asterisk { font-size: 100%; vertical-align: 0; }\n \n</style>\n<table class="gt_table" data-quarto-disable-processing="false" data-quarto-bootstrap="false">\n<thead>\n\n  <tr class="gt_heading">\n    <td colspan="3" class="gt_heading gt_title gt_font_normal">Data listing from <strong>gtcars</strong></td>\n  </tr>\n  <tr class="gt_heading">\n    <td colspan="3" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">gtcars is an R dataset</td>\n  </tr>\n<tr class="gt_col_headings">\n  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="mfr">mfr</th>\n  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="model">model</th>\n  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="msrp">msrp</th>\n</tr>\n</thead>\n<tbody class="gt_table_body">\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ford</td>\n    <td class="gt_row gt_left">GT</td>\n    <td class="gt_row gt_right">$447,000.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">458 Speciale</td>\n    <td class="gt_row gt_right">$291,744.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">458 Spider</td>\n    <td class="gt_row gt_right">$263,553.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">458 Italia</td>\n    <td class="gt_row gt_right">$233,509.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">488 GTB</td>\n    <td class="gt_row gt_right">$245,400.00</td>\n  </tr>\n</tbody>\n\n\n</table>\n\n</div>\n        \n</body>\n</html>\n            '
    +
    '<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8"/>\n</head>\n<body>\n<div id="hhmpnixtaz" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">\n<style>\n#hhmpnixtaz table {\n          font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen, Ubuntu, Cantarell, \'Helvetica Neue\', \'Fira Sans\', \'Droid Sans\', Arial, sans-serif;\n          -webkit-font-smoothing: antialiased;\n          -moz-osx-font-smoothing: grayscale;\n        }\n\n#hhmpnixtaz thead, tbody, tfoot, tr, td, th { border-style: none; }\n tr { background-color: transparent; }\n#hhmpnixtaz p { margin: 0; padding: 0; }\n #hhmpnixtaz .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }\n #hhmpnixtaz .gt_caption { padding-top: 4px; padding-bottom: 4px; }\n #hhmpnixtaz .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }\n #hhmpnixtaz .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-top-color: #FFFFFF; border-top-width: 0; }\n #hhmpnixtaz .gt_heading { background-color: Azure; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\n #hhmpnixtaz .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\n #hhmpnixtaz .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\n #hhmpnixtaz .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }\n #hhmpnixtaz .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }\n #hhmpnixtaz .gt_column_spanner_outer:first-child { padding-left: 0; }\n #hhmpnixtaz .gt_column_spanner_outer:last-child { padding-right: 0; }\n #hhmpnixtaz .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }\n #hhmpnixtaz .gt_spanner_row { border-bottom-style: hidden; }\n #hhmpnixtaz .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }\n #hhmpnixtaz .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }\n #hhmpnixtaz .gt_from_md> :first-child { margin-top: 0; }\n #hhmpnixtaz .gt_from_md> :last-child { margin-bottom: 0; }\n #hhmpnixtaz .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; margin: 10px; border-top-style: solid; border-top-width: 2px; border-top-color: Lavender; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }\n #hhmpnixtaz .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; }\n #hhmpnixtaz .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; vertical-align: top; }\n #hhmpnixtaz .gt_row_group_first td { border-top-width: 2px; }\n #hhmpnixtaz .gt_row_group_first th { border-top-width: 2px; }\n #hhmpnixtaz .gt_striped { background-color: rgba(128,128,128,0.05); }\n #hhmpnixtaz .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\n #hhmpnixtaz .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }\n #hhmpnixtaz .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }\n #hhmpnixtaz .gt_left { text-align: left; }\n #hhmpnixtaz .gt_center { text-align: center; }\n #hhmpnixtaz .gt_right { text-align: right; font-variant-numeric: tabular-nums; }\n #hhmpnixtaz .gt_font_normal { font-weight: normal; }\n #hhmpnixtaz .gt_font_bold { font-weight: bold; }\n #hhmpnixtaz .gt_font_italic { font-style: italic; }\n #hhmpnixtaz .gt_super { font-size: 65%; }\n #hhmpnixtaz .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }\n #hhmpnixtaz .gt_asterisk { font-size: 100%; vertical-align: 0; }\n \n</style>\n<table class="gt_table" data-quarto-disable-processing="false" data-quarto-bootstrap="false">\n<thead>\n\n  <tr class="gt_heading">\n    <td colspan="3" class="gt_heading gt_title gt_font_normal">Data listing from <strong>gtcars</strong></td>\n  </tr>\n  <tr class="gt_heading">\n    <td colspan="3" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border">gtcars is an R dataset</td>\n  </tr>\n<tr class="gt_col_headings">\n  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="mfr">mfr</th>\n  <th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="model">model</th>\n  <th class="gt_col_heading gt_columns_bottom_border gt_right" rowspan="1" colspan="1" scope="col" id="msrp">msrp</th>\n</tr>\n</thead>\n<tbody class="gt_table_body">\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ford</td>\n    <td class="gt_row gt_left">GT</td>\n    <td class="gt_row gt_right">$447,000.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">458 Speciale</td>\n    <td class="gt_row gt_right">$291,744.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">458 Spider</td>\n    <td class="gt_row gt_right">$263,553.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">458 Italia</td>\n    <td class="gt_row gt_right">$233,509.00</td>\n  </tr>\n  <tr>\n    <td style="background-color: LightCyan;" class="gt_row gt_left">Ferrari</td>\n    <td class="gt_row gt_left">488 GTB</td>\n    <td class="gt_row gt_right">$245,400.00</td>\n  </tr>\n</tbody>\n\n\n</table>\n\n</div>\n        \n</body>\n</html>\n            '

    Should you want to include all of the CSS styles as inline styles, you can use inline_css=True to get an HTML string with all CSS inlined into the HTML tags.

    -
    +
    gt_tbl.as_raw_html(inline_css=True)
    -
    '<div id="qgokjidufa" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">\n\n<table class="gt_table" data-quarto-bootstrap="false" data-quarto-disable-processing="false" style="font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen, Ubuntu, Cantarell, \'Helvetica Neue\', \'Fira Sans\', \'Droid Sans\', Arial, sans-serif;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;display: table;border-collapse: collapse;line-height: normal;margin-left: auto;margin-right: auto;color: #333333;font-size: 16px;font-weight: normal;font-style: normal;background-color: #FFFFFF;width: auto;border-top-style: solid;border-top-width: 2px;border-top-color: #A8A8A8;border-right-style: none;border-right-width: 2px;border-right-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;border-bottom-color: #A8A8A8;border-left-style: none;border-left-width: 2px;border-left-color: #D3D3D3;">\n<thead style="border-style: none;">\n\n  <tr class="gt_heading" style="border-style: none;background-color: Azure;text-align: center;border-bottom-color: #FFFFFF;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;">\n    <td class="gt_heading gt_title gt_font_normal" colspan="3" style="border-style: none;color: #333333;font-size: 125%;font-weight: normal;padding-top: 4px;padding-bottom: 4px;padding-left: 10px;padding-right: 10px;border-bottom-color: #FFFFFF;border-bottom-width: 0;background-color: Azure;text-align: center;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;">Data listing from <strong>gtcars</strong></td>\n  </tr>\n  <tr class="gt_heading" style="border-style: none;background-color: Azure;text-align: center;border-bottom-color: #FFFFFF;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;">\n    <td class="gt_heading gt_subtitle gt_font_normal gt_bottom_border" colspan="3" style="border-style: none;color: #333333;font-size: 85%;font-weight: normal;padding-top: 3px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;border-top-color: #FFFFFF;border-top-width: 0;background-color: Azure;text-align: center;border-bottom-color: #D3D3D3;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;">gtcars is an R dataset</td>\n  </tr>\n<tr class="gt_col_headings" style="border-style: none;background-color: transparent;border-top-style: solid;border-top-width: 2px;border-top-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;border-bottom-color: #D3D3D3;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;">\n  <th class="gt_col_heading gt_columns_bottom_border gt_left" id="mfr" rowspan="1" colspan="1" scope="col" style="border-style: none;color: #333333;background-color: #FFFFFF;font-size: 100%;font-weight: normal;text-transform: inherit;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: bottom;padding-top: 5px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;overflow-x: hidden;text-align: left;">mfr</th>\n  <th class="gt_col_heading gt_columns_bottom_border gt_left" id="model" rowspan="1" colspan="1" scope="col" style="border-style: none;color: #333333;background-color: #FFFFFF;font-size: 100%;font-weight: normal;text-transform: inherit;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: bottom;padding-top: 5px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;overflow-x: hidden;text-align: left;">model</th>\n  <th class="gt_col_heading gt_columns_bottom_border gt_right" id="msrp" rowspan="1" colspan="1" scope="col" style="border-style: none;color: #333333;background-color: #FFFFFF;font-size: 100%;font-weight: normal;text-transform: inherit;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: bottom;padding-top: 5px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;">msrp</th>\n</tr>\n</thead>\n<tbody class="gt_table_body" style="border-style: none;border-top-style: solid;border-top-width: 2px;border-top-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;border-bottom-color: #D3D3D3;">\n  <tr style="border-style: none;background-color: transparent;">\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan">Ford</td>\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;">GT</td>\n    <td class="gt_row gt_right" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;">$447,000.00</td>\n  </tr>\n  <tr style="border-style: none;background-color: transparent;">\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan">Ferrari</td>\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;">458 Speciale</td>\n    <td class="gt_row gt_right" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;">$291,744.00</td>\n  </tr>\n  <tr style="border-style: none;background-color: transparent;">\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan">Ferrari</td>\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;">458 Spider</td>\n    <td class="gt_row gt_right" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;">$263,553.00</td>\n  </tr>\n  <tr style="border-style: none;background-color: transparent;">\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan">Ferrari</td>\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;">458 Italia</td>\n    <td class="gt_row gt_right" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;">$233,509.00</td>\n  </tr>\n  <tr style="border-style: none;background-color: transparent;">\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan">Ferrari</td>\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;">488 GTB</td>\n    <td class="gt_row gt_right" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;">$245,400.00</td>\n  </tr>\n</tbody>\n\n\n</table>\n\n</div>'
    +
    '<div id="povwlrbjit" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">\n\n<table class="gt_table" data-quarto-bootstrap="false" data-quarto-disable-processing="false" style="font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, Oxygen, Ubuntu, Cantarell, \'Helvetica Neue\', \'Fira Sans\', \'Droid Sans\', Arial, sans-serif;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;display: table;border-collapse: collapse;line-height: normal;margin-left: auto;margin-right: auto;color: #333333;font-size: 16px;font-weight: normal;font-style: normal;background-color: #FFFFFF;width: auto;border-top-style: solid;border-top-width: 2px;border-top-color: #A8A8A8;border-right-style: none;border-right-width: 2px;border-right-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;border-bottom-color: #A8A8A8;border-left-style: none;border-left-width: 2px;border-left-color: #D3D3D3;">\n<thead style="border-style: none;">\n\n  <tr class="gt_heading" style="border-style: none;background-color: Azure;text-align: center;border-bottom-color: #FFFFFF;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;">\n    <td class="gt_heading gt_title gt_font_normal" colspan="3" style="border-style: none;color: #333333;font-size: 125%;font-weight: normal;padding-top: 4px;padding-bottom: 4px;padding-left: 10px;padding-right: 10px;border-bottom-color: #FFFFFF;border-bottom-width: 0;background-color: Azure;text-align: center;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;">Data listing from <strong>gtcars</strong></td>\n  </tr>\n  <tr class="gt_heading" style="border-style: none;background-color: Azure;text-align: center;border-bottom-color: #FFFFFF;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;">\n    <td class="gt_heading gt_subtitle gt_font_normal gt_bottom_border" colspan="3" style="border-style: none;color: #333333;font-size: 85%;font-weight: normal;padding-top: 3px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;border-top-color: #FFFFFF;border-top-width: 0;background-color: Azure;text-align: center;border-bottom-color: #D3D3D3;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;">gtcars is an R dataset</td>\n  </tr>\n<tr class="gt_col_headings" style="border-style: none;background-color: transparent;border-top-style: solid;border-top-width: 2px;border-top-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;border-bottom-color: #D3D3D3;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;">\n  <th class="gt_col_heading gt_columns_bottom_border gt_left" id="mfr" rowspan="1" colspan="1" scope="col" style="border-style: none;color: #333333;background-color: #FFFFFF;font-size: 100%;font-weight: normal;text-transform: inherit;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: bottom;padding-top: 5px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;overflow-x: hidden;text-align: left;">mfr</th>\n  <th class="gt_col_heading gt_columns_bottom_border gt_left" id="model" rowspan="1" colspan="1" scope="col" style="border-style: none;color: #333333;background-color: #FFFFFF;font-size: 100%;font-weight: normal;text-transform: inherit;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: bottom;padding-top: 5px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;overflow-x: hidden;text-align: left;">model</th>\n  <th class="gt_col_heading gt_columns_bottom_border gt_right" id="msrp" rowspan="1" colspan="1" scope="col" style="border-style: none;color: #333333;background-color: #FFFFFF;font-size: 100%;font-weight: normal;text-transform: inherit;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: bottom;padding-top: 5px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;">msrp</th>\n</tr>\n</thead>\n<tbody class="gt_table_body" style="border-style: none;border-top-style: solid;border-top-width: 2px;border-top-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;border-bottom-color: #D3D3D3;">\n  <tr style="border-style: none;background-color: transparent;">\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan">Ford</td>\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;">GT</td>\n    <td class="gt_row gt_right" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;">$447,000.00</td>\n  </tr>\n  <tr style="border-style: none;background-color: transparent;">\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan">Ferrari</td>\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;">458 Speciale</td>\n    <td class="gt_row gt_right" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;">$291,744.00</td>\n  </tr>\n  <tr style="border-style: none;background-color: transparent;">\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan">Ferrari</td>\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;">458 Spider</td>\n    <td class="gt_row gt_right" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;">$263,553.00</td>\n  </tr>\n  <tr style="border-style: none;background-color: transparent;">\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan">Ferrari</td>\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;">458 Italia</td>\n    <td class="gt_row gt_right" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;">$233,509.00</td>\n  </tr>\n  <tr style="border-style: none;background-color: transparent;">\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan">Ferrari</td>\n    <td class="gt_row gt_left" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;">488 GTB</td>\n    <td class="gt_row gt_right" style="border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;">$245,400.00</td>\n  </tr>\n</tbody>\n\n\n</table>\n\n</div>'
    diff --git a/reference/GT.cols_align.html b/reference/GT.cols_align.html index 2076dfbe0..13c371d16 100644 --- a/reference/GT.cols_align.html +++ b/reference/GT.cols_align.html @@ -235,7 +235,7 @@

    Re

    Examples

    Let’s use the countrypops to create a small table. We can change the alignment of the population column with cols_align(). In this example, the column label and body cells of population will be aligned to the left.

    -
    +
    from great_tables import GT
     from great_tables.data import countrypops
     
    @@ -248,52 +248,52 @@ 

    .cols_align(align="left", columns="population") )

    -
    +

    diff --git a/reference/GT.cols_hide.html b/reference/GT.cols_hide.html index 2daa9cbe3..0af8f807f 100644 --- a/reference/GT.cols_hide.html +++ b/reference/GT.cols_hide.html @@ -232,7 +232,7 @@

    Re

    Examples

    For this example, we’ll use a portion of the countrypops dataset to create a simple table. Let’s hide the year column with the cols_hide() method.

    -
    +
    from great_tables import GT
     from great_tables.data import countrypops
     
    @@ -242,52 +242,52 @@ 

    GT(countrypops_mini).cols_hide(columns="year")

    -
    +

    diff --git a/reference/GT.cols_label.html b/reference/GT.cols_label.html index 5206fa16b..1c3da4d79 100644 --- a/reference/GT.cols_label.html +++ b/reference/GT.cols_label.html @@ -246,7 +246,7 @@

    Notes<

    Examples

    The example below relabels columns from the countrypops data to start with uppercase.

    -
    +
    from great_tables import GT
     from great_tables.data import countrypops
     
    @@ -263,52 +263,52 @@ 

    ) )

    -
    +

    @@ -357,7 +357,7 @@

    Note that we supplied the name of the column as the key, and the new label as the value.

    We can also use Markdown formatting for the column labels. In this example, we’ll use md("*Population*") to make the label italicized.

    -
    +
    from great_tables import GT, md
     from great_tables.data import countrypops
     
    @@ -370,52 +370,52 @@ 

    ) )

    -
    +

    @@ -463,7 +463,7 @@

    We can also use unit notation to format the column labels. In this example, we’ll use {cm^3 molecules^-1 s^-1} for part of the label for the OH_k298 column.

    -
    +
    from great_tables import GT
     from great_tables.data import reactions
     import polars as pl
    @@ -484,52 +484,52 @@ 

    ) )

    -
    +

    diff --git a/reference/GT.cols_move.html b/reference/GT.cols_move.html index 9abab1ade..423f14b7d 100644 --- a/reference/GT.cols_move.html +++ b/reference/GT.cols_move.html @@ -236,7 +236,7 @@

    Re

    Examples

    Let’s use the countrypops dataset to create a table. We’ll choose to position the population column after the country_name column by using the cols_move() method.

    -
    +
    from great_tables import GT
     from great_tables.data import countrypops
     
    @@ -252,52 +252,52 @@ 

    ) )

    -
    +

    diff --git a/reference/GT.cols_move_to_end.html b/reference/GT.cols_move_to_end.html index d611dee6d..d97315b6b 100644 --- a/reference/GT.cols_move_to_end.html +++ b/reference/GT.cols_move_to_end.html @@ -231,7 +231,7 @@

    Re

    Examples

    For this example, we’ll use a portion of the countrypops dataset to create a simple table. Let’s move the year column, which is the middle column, to the end of the column series with the cols_move_to_end() method.

    -
    +
    from great_tables import GT
     from great_tables.data import countrypops
     
    @@ -241,52 +241,52 @@ 

    GT(countrypops_mini).cols_move_to_end(columns="year")

    -
    +

    @@ -334,55 +334,55 @@

    We can also move multiple columns at a time. With the same countrypops-based table (countrypops_mini), let’s move both the year and country_name columns to the end of the column series.

    -
    +
    GT(countrypops_mini).cols_move_to_end(columns=["year", "country_name"])
    -
    +

    diff --git a/reference/GT.cols_move_to_start.html b/reference/GT.cols_move_to_start.html index f3f9762b1..e14a32642 100644 --- a/reference/GT.cols_move_to_start.html +++ b/reference/GT.cols_move_to_start.html @@ -232,7 +232,7 @@

    Re

    Examples

    For this example, we’ll use a portion of the countrypops dataset to create a simple table. Let’s move the year column, which is the middle column, to the start of the column series with the cols_move_to_start() method.

    -
    +
    from great_tables import GT
     from great_tables.data import countrypops
     
    @@ -242,52 +242,52 @@ 

    GT(countrypops_mini).cols_move_to_start(columns="year")

    -
    +

    @@ -335,55 +335,55 @@

    We can also move multiple columns at a time. With the same countrypops-based table (countrypops_mini), let’s move both the year and population columns to the start of the column series.

    -
    +
    GT(countrypops_mini).cols_move_to_start(columns=["year", "population"])
    -
    +

    diff --git a/reference/GT.cols_width.html b/reference/GT.cols_width.html index 2f2c9f4d9..c8de08fbd 100644 --- a/reference/GT.cols_width.html +++ b/reference/GT.cols_width.html @@ -235,7 +235,7 @@

    Re

    Examples

    Let’s use select columns from the exibble dataset to create a new table. We can specify the widths of columns with cols_width(). This is done by specifying the exact widths for table columns in a dictionary. In this example, we’ll set the width of the num column to "150px", the char column to "100px", the date column to "300px". All other columns won’t be affected (their widths will be automatically set by their content).

    -
    +
    from great_tables import GT, exibble
     
     exibble_mini = exibble[["num", "char", "date", "datetime", "row"]].head(5)
    @@ -251,52 +251,52 @@ 

    ) )

    -
    +

    @@ -364,7 +364,7 @@

    We can also specify the widths of columns as percentages. In this example, we’ll set the width of the num column to "20%", the char column to "10%", and the date column to "30%". Note that the percentages are relative and don’t need to sum to 100%.

    -
    +
    (
         GT(exibble_mini)
         .cols_width(
    @@ -376,52 +376,52 @@ 

    ) )

    -
    +

    @@ -489,7 +489,7 @@

    We can also mix and match pixel and percentage widths. In this example, we’ll set the width of the num column to "150px", the char column to "10%", and the date column to "30%".

    -
    +
    (
         GT(exibble_mini)
         .cols_width(
    @@ -501,52 +501,52 @@ 

    ) )

    -
    +

    @@ -614,7 +614,7 @@

    If we set the width of all columns, the table will be forced to use the specified widths (i.e., a column width less than the content width will be honored). In this next example, we’ll set widths for all columns. This is a good way to ensure that the widths you specify are fully respected (and not overridden by automatic width calculations).

    -
    +
    (
         GT(exibble_mini)
         .cols_width(
    @@ -628,52 +628,52 @@ 

    ) )

    -
    +

    diff --git a/reference/GT.data_color.html b/reference/GT.data_color.html index 69f094be5..345de2fca 100644 --- a/reference/GT.data_color.html +++ b/reference/GT.data_color.html @@ -539,58 +539,58 @@

    Examples

    The data_color() method can be used without any supplied arguments to colorize a table. Let’s do this with the exibble dataset:

    -
    +
    from great_tables import GT
     from great_tables.data import exibble
     
     GT(exibble).data_color()
    -
    +
    @@ -708,58 +708,58 @@

    What’s happened is that data_color() applies background colors to all cells of every column with the palette of eight colors. Numeric columns will use ‘numeric’ methodology for color scaling whereas string-based columns will use the ‘factor’ methodology. The text color undergoes an automatic modification that maximizes contrast (since autocolor_text=True by default).

    We can target specific colors and apply color to just those columns. Let’s do that and also supply palette= values of "red" and "green".

    -
    +
    GT(exibble).data_color(
         columns=["num", "currency"],
         palette=["red", "green"]
     )
    -
    +

    @@ -877,7 +877,7 @@

    With those options in place we see that only the numeric columns num and currency received color treatments. Moreover, the palette colors were mapped to the lower and upper limits of the data in each column; interpolated colors were used for the values in between the numeric limits of the two columns.

    We can manually set the limits of the data with the domain= argument (which is preferable in most cases). Let’s colorize just the currency column and set domain=[0, 50]. Any values that are either missing or lie outside of the domain will be colorized with the na_color= color (so we’ll set that to "lightgray").

    -
    +
    GT(exibble).data_color(
         columns="currency",
         palette=["red", "green"],
    @@ -885,52 +885,52 @@ 

    na_color="lightgray" )

    -
    +

    diff --git a/reference/GT.fmt.html b/reference/GT.fmt.html index 6b7d59c56..d3c33cd83 100644 --- a/reference/GT.fmt.html +++ b/reference/GT.fmt.html @@ -244,7 +244,7 @@

    Re

    Examples

    Let’s use the exibble dataset to create a table. With the fmt() method, we’ll add a prefix ^ and a suffix $ to the row and group columns.

    -
    +
    from great_tables import GT, exibble
     
     (
    @@ -252,52 +252,52 @@ 

    .fmt(lambda x: f"^{x}$", columns=["row", "group"]) )

    -
    +

    diff --git a/reference/GT.fmt_bytes.html b/reference/GT.fmt_bytes.html index 94a1c0c68..f20353d67 100644 --- a/reference/GT.fmt_bytes.html +++ b/reference/GT.fmt_bytes.html @@ -308,7 +308,7 @@

    Examples

    Let’s use a single column from the exibble dataset and create a new table. We’ll format the num column to display as byte sizes in the decimal standard through use of the fmt_bytes() method.

    -
    +
    from great_tables import GT, exibble
     
     (
    @@ -316,52 +316,52 @@ 

    .fmt_bytes(columns="num", standard="decimal") )

    -
    +
    diff --git a/reference/GT.fmt_currency.html b/reference/GT.fmt_currency.html index 689421e7c..204519373 100644 --- a/reference/GT.fmt_currency.html +++ b/reference/GT.fmt_currency.html @@ -325,7 +325,7 @@

    Examples

    Let’s use the exibble dataset to create a table. With the fmt_currency() method, we’ll format the currency column to display monetary values.

    -
    +
    from great_tables import GT, exibble
     
     (
    @@ -337,52 +337,52 @@ 

    ) )

    -
    +
    diff --git a/reference/GT.fmt_date.html b/reference/GT.fmt_date.html index 5462a6990..c996bcf09 100644 --- a/reference/GT.fmt_date.html +++ b/reference/GT.fmt_date.html @@ -362,7 +362,7 @@

    Examples

    Let’s use the exibble dataset to create a simple, two-column table (keeping only the date and time columns). With the fmt_date() method, we’ll format the date column to display dates formatted with the "month_day_year" date style.

    -
    +
    from great_tables import GT, exibble
     
     exibble_mini = exibble[["date", "time"]]
    @@ -372,52 +372,52 @@ 

    .fmt_date(columns="date", date_style="month_day_year") )

    -
    +
    diff --git a/reference/GT.fmt_datetime.html b/reference/GT.fmt_datetime.html index 5d772f0d8..1dbcc0047 100644 --- a/reference/GT.fmt_datetime.html +++ b/reference/GT.fmt_datetime.html @@ -397,7 +397,7 @@

    Re

    Examples

    Let’s use the exibble dataset to create a simple, two-column table (keeping only the date and time columns). With the fmt_datetime() method, we’ll format the date column to display dates formatted with the "month_day_year" date style and the time column to display times formatted with the "h_m_s_p" time style.

    -
    +
    from great_tables import GT, exibble
     
     exibble_mini = exibble[["date", "time"]]
    @@ -411,52 +411,52 @@ 

    ) )

    -
    +

    diff --git a/reference/GT.fmt_flag.html b/reference/GT.fmt_flag.html index 985cd5465..b53fc2d7b 100644 --- a/reference/GT.fmt_flag.html +++ b/reference/GT.fmt_flag.html @@ -255,7 +255,7 @@

    Re

    Examples

    Let’s use the countrypops dataset to create a new table with flag icons. We will only include a few columns and rows from that table. The country_code_2 column has 2-letter country codes in the format required for fmt_flag() and using that method transforms the codes to circular flag icons.

    -
    +
    from great_tables import GT
     from great_tables.data import countrypops
     import polars as pl
    @@ -281,52 +281,52 @@ 

    .cols_move_to_start(columns="country_code_2") )

    -
    +

    @@ -399,7 +399,7 @@

    Here’s another example (again using countrypops) where we generate a table providing populations every five years for the Benelux countries ("BEL", "NLD", and "LUX"). After some filtering and a pivot, the fmt_flag() method is used to obtain flag icons from 3-letter country codes present in the country_code_3 column.

    -
    +
    import polars.selectors as cs
     
     countrypops_mini = (
    @@ -421,52 +421,52 @@ 

    ) )

    -
    +

    diff --git a/reference/GT.fmt_icon.html b/reference/GT.fmt_icon.html index 10c130f05..98bf9609f 100644 --- a/reference/GT.fmt_icon.html +++ b/reference/GT.fmt_icon.html @@ -284,7 +284,7 @@

    Re

    Examples

    For this first example of generating icons with fmt_icon(), let’s make a simple DataFrame that has two columns of Font Awesome icon names. We separate multiple icons per cell with commas. By default, the icons are 1 em in height; we’re going to make the icons slightly larger here (so we can see the fine details of them) by setting height = “4em”.

    -
    +
    import pandas as pd
     from great_tables import GT
     
    @@ -307,52 +307,52 @@ 

    ) )

    -
    +

    @@ -394,7 +394,7 @@

    Let’s take a few rows from the towny dataset and make it so the csd_type column contains Font Awesome icon names (we want only the "city" and "house-chimney" icons here). After using fmt_icon() to format the csd_type column, we get icons that are representative of the two categories of municipality for this subset of data.

    -
    +
    import polars as pl
     from great_tables.data import towny
     
    @@ -419,52 +419,52 @@ 

    ) )

    -
    +

    @@ -507,7 +507,7 @@

    A fairly common thing to do with icons in tables is to indicate whether a quantity is either higher or lower than another. Up and down arrow symbols can serve as good visual indicators for this purpose. We can make use of the "up-arrow" and "down-arrow" icons here. As those strings are available in the dir column of the table derived from the sp500 dataset, fmt_icon() can be used. We set the fill_color argument with a dictionary that indicates which color should be used for each icon.

    -
    +
    from great_tables.data import sp500
     
     sp500_mini = (
    @@ -535,52 +535,52 @@ 

    .opt_stylize(style=1, color="gray") )

    -
    +

    diff --git a/reference/GT.fmt_image.html b/reference/GT.fmt_image.html index 561f9a0bc..c67f747d6 100644 --- a/reference/GT.fmt_image.html +++ b/reference/GT.fmt_image.html @@ -269,7 +269,7 @@

    Re

    Examples

    Using a small portion of metro dataset, let’s create a new table. We will only include a few columns and rows from that table. The lines column has comma-separated listings of numbers corresponding to lines served at each station. We have a directory of SVG graphics for all of these lines in the package (the path for the image directory can be accessed via files("great_tables") / "data/metro_images", using the importlib_resources package). The filenames roughly corresponds to the data in the lines column. The fmt_image() method can be used with these inputs since the path= and file_pattern= arguments allow us to compose complete and valid file locations. What you get from this are sequences of images in the table cells, taken from the referenced graphics files on disk.

    -
    +
    from great_tables import GT
     from great_tables.data import metro
     from importlib_resources import files
    @@ -288,52 +288,52 @@ 

    .fmt_integer(columns="passengers") )

    -
    +

    diff --git a/reference/GT.fmt_integer.html b/reference/GT.fmt_integer.html index 3aa9953ff..2f1d221a1 100644 --- a/reference/GT.fmt_integer.html +++ b/reference/GT.fmt_integer.html @@ -294,7 +294,7 @@

    Examples

    For this example, we’ll use the exibble dataset as the input table. With the fmt_integer() method, we’ll format the num column as integer values having no digit separators (with the use_seps=False option).

    -
    +
    from great_tables import GT, exibble
     
     (
    @@ -302,52 +302,52 @@ 

    .fmt_integer(columns="num", use_seps=False) )

    -
    +
    diff --git a/reference/GT.fmt_markdown.html b/reference/GT.fmt_markdown.html index 2b3a28191..73359ee4c 100644 --- a/reference/GT.fmt_markdown.html +++ b/reference/GT.fmt_markdown.html @@ -236,7 +236,7 @@

    Re

    Examples:

    Let’s first create a DataFrame containing some text that is Markdown-formatted and then introduce that to GT(). We’ll then transform the md column with the fmt_markdown() method.

    -
    +
    import pandas as pd
     from great_tables import GT
     from great_tables.data import towny
    @@ -260,52 +260,52 @@ 

    (GT(df).fmt_markdown("md"))

    -
    +

    diff --git a/reference/GT.fmt_nanoplot.html b/reference/GT.fmt_nanoplot.html index 0745c960c..8b16dbe80 100644 --- a/reference/GT.fmt_nanoplot.html +++ b/reference/GT.fmt_nanoplot.html @@ -303,7 +303,7 @@

    De

    Examples

    Let’s create a nanoplot from a Polars DataFrame containing multiple numbers per cell. The numbers are represented here as strings, where spaces separate the values, and the same values are present in two columns: lines and bars. We will use the fmt_nanoplot() method twice to create a line plot and a bar plot from the data in their respective columns.

    -
    +
    from great_tables import GT
     import polars as pl
     
    @@ -325,52 +325,52 @@ 

    .fmt_nanoplot(columns="bars", plot_type="bar") )

    -
    +

    @@ -413,7 +413,7 @@

    We can always represent the input DataFrame in a different way (with list columns) and fmt_nanoplot() will still work. While the input data is the same as in the previous example, we’ll take the opportunity here to add a reference line and a reference area to the line plot and also to the bar plot.

    -
    +
    random_numbers_df = pl.DataFrame(
         {
             "i": range(1, 5),
    @@ -440,52 +440,52 @@ 

    reference_area=["max", "median"]) )

    -
    +

    @@ -528,7 +528,7 @@

    Here’s an example to adjust some of the options using nanoplot_options().

    -
    +
    from great_tables import nanoplot_options
     
     (
    @@ -568,52 +568,52 @@ 

    ) )

    -
    +

    @@ -656,7 +656,7 @@

    Single-value bar plots and line plots can be made with fmt_nanoplot(). These run in the horizontal direction, which is ideal for tabular presentation. The key thing here is that fmt_nanoplot() expects a column of numeric values. These plots are meant for comparison across rows so the method automatically scales the horizontal bars to facilitate this type of display. The following example shows how fmt_nanoplot() can be used to create single-value bar and line plots.

    -
    +
    single_vals_df = pl.DataFrame(
         {
             "i": range(1, 6),
    @@ -670,52 +670,52 @@ 

    .fmt_nanoplot(columns="lines", plot_type="line") )

    -
    +

    diff --git a/reference/GT.fmt_number.html b/reference/GT.fmt_number.html index d3f1e3989..2aedd53a3 100644 --- a/reference/GT.fmt_number.html +++ b/reference/GT.fmt_number.html @@ -319,7 +319,7 @@

    Examples

    Let’s use the exibble dataset to create a table. With the fmt_number() method, we’ll format the num column to have three decimal places (with decimals=3) and omit the use of digit separators (with use_seps=False).

    -
    +
    from great_tables import GT, exibble
     
     (
    @@ -327,52 +327,52 @@ 

    .fmt_number(columns="num", decimals=3, use_seps=False) )

    -
    +
    diff --git a/reference/GT.fmt_percent.html b/reference/GT.fmt_percent.html index 126a742e2..9af2e8733 100644 --- a/reference/GT.fmt_percent.html +++ b/reference/GT.fmt_percent.html @@ -319,7 +319,7 @@

    Examples

    Let’s use the towny dataset as the input table. With the fmt_percent() method, we’ll format the pop_change_2016_2021_pct column to to display values as percentages (to two decimal places).

    -
    +
    from great_tables import GT
     from great_tables.data import towny
     
    @@ -330,52 +330,52 @@ 

    (GT(towny_mini).fmt_percent("pop_change_2016_2021_pct", decimals=2))

    -
    +
    diff --git a/reference/GT.fmt_roman.html b/reference/GT.fmt_roman.html index 48bcee46e..10b8021b5 100644 --- a/reference/GT.fmt_roman.html +++ b/reference/GT.fmt_roman.html @@ -244,7 +244,7 @@

    Re

    Examples

    Let’s first create a DataFrame containing small numeric values and then introduce that to GT(). We’ll then format the roman column to appear as Roman numerals with the fmt_roman() method.

    -
    +
    import pandas as pd
     from great_tables import GT
     
    @@ -255,52 +255,52 @@ 

    .fmt_roman(columns="roman") )

    -
    +

    diff --git a/reference/GT.fmt_scientific.html b/reference/GT.fmt_scientific.html index 71a7e75fb..a7eda17a7 100644 --- a/reference/GT.fmt_scientific.html +++ b/reference/GT.fmt_scientific.html @@ -313,7 +313,7 @@

    Examples

    For this example, we’ll use the exibble dataset as the input table. With the fmt_scientific() method, we’ll format the num column to contain values in scientific formatting.

    -
    +
    from great_tables import GT, exibble
     
     (
    @@ -321,52 +321,52 @@ 

    .fmt_scientific(columns="num") )

    -
    +
    diff --git a/reference/GT.fmt_time.html b/reference/GT.fmt_time.html index 149b58423..1ee7bff0a 100644 --- a/reference/GT.fmt_time.html +++ b/reference/GT.fmt_time.html @@ -308,7 +308,7 @@

    Examples

    Let’s use the exibble dataset to create a simple, two-column table (keeping only the date and time columns). With the fmt_time() method, we’ll format the time column to display times formatted with the "h_m_s_p" time style.

    -
    +
    from great_tables import GT, exibble
     
     exibble_mini = exibble[["date", "time"]]
    @@ -318,52 +318,52 @@ 

    .fmt_time(columns="time", time_style="h_m_s_p") )

    -
    +
    diff --git a/reference/GT.fmt_units.html b/reference/GT.fmt_units.html index 43a71383c..9abe6354c 100644 --- a/reference/GT.fmt_units.html +++ b/reference/GT.fmt_units.html @@ -258,7 +258,7 @@

    Re

    Examples

    Let’s use the illness dataset and create a new table. The units column happens to contain string values in units notation (e.g., "x10^9 / L"). Using the fmt_units() method here will improve the formatting of those measurement units.

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import illness
     
    @@ -284,52 +284,52 @@ 

    .opt_vertical_padding(scale=0.5) )

    -
    +

    @@ -878,7 +878,7 @@

    The constants dataset contains values for hundreds of fundamental physical constants. We’ll take a subset of values that have some molar basis and generate a new display table from that. Like the illness dataset, this one has a units column so, again, the fmt_units() method will be used to format those units. Here, the preference for typesetting measurement units is to have positive and negative exponents (e.g., not "<unit_1> / <unit_2>" but rather "<unit_1> <unit_2>^-1").

    -
    +
    from great_tables.data import constants
     import polars as pl
     import polars.selectors as cs
    @@ -903,52 +903,52 @@ 

    .tab_options(column_labels_hidden=True) )

    -
    +

    diff --git a/reference/GT.html b/reference/GT.html index b10135878..a8f02554e 100644 --- a/reference/GT.html +++ b/reference/GT.html @@ -261,57 +261,57 @@

    Re

    Examples

    Let’s use the exibble dataset for the next few examples, we’ll learn how to make simple output tables with the GT() class. The most basic thing to do is to just use GT() with the dataset as the input.

    -
    +
    from great_tables import GT, exibble
     
     GT(exibble)
    -
    +

    @@ -428,57 +428,57 @@

    This dataset has the row and group columns. The former contains unique values that are ideal for labeling rows, and this often happens in what is called the ‘stub’ (a reserved area that serves to label rows). With the GT() class, we can immediately place the contents of the row column into the stub column. To do this, we use the rowname_col= argument with the appropriate column name.

    -
    +
    from great_tables import GT, exibble
     
     GT(exibble, rowname_col="row")
    -
    +

    @@ -596,57 +596,57 @@

    This sets up a table with a stub, the row labels are placed within the stub column, and a vertical dividing line has been placed on the right-hand side.

    The group column contains categorical values that are ideal for grouping rows. We can use the groupname_col= argument to place these values into row groups.

    -
    +
    from great_tables import GT, exibble
     
     GT(exibble, rowname_col="row", groupname_col="group")
    -
    +

    @@ -760,57 +760,57 @@

    By default, values in the body of a table (and their column labels) are automatically aligned. The alignment is governed by the types of values in a column. If you’d like to disable this form of auto-alignment, the auto_align=False option can be taken.

    -
    +
    from great_tables import GT, exibble
     
     GT(exibble, rowname_col="row", auto_align=False)
    -
    +

    @@ -928,7 +928,7 @@

    What you’ll get from that is center-alignment of all table body values and all column labels. Note that row labels in the the stub are still left-aligned; and auto_align= has no effect on alignment within the table stub.

    However which way you generate the initial table object, you can modify it with a huge variety of methods to further customize the presentation. Formatting body cells is commonly done with the family of formatting methods (e.g., fmt_number(), fmt_date(), etc.). The package supports formatting with internationalization (‘i18n’ features) and so locale-aware methods all come with a locale= argument. To avoid having to use that argument repeatedly, the GT() class has its own locale= argument. Setting a locale in that will make it available globally. Here’s an example of how that works in practice when setting locale = "fr" in GT() prior to using formatting methods:

    -
    +
    from great_tables import GT, exibble
     
     (
    @@ -938,52 +938,52 @@ 

    .fmt_date(columns="date", date_style="day_month_year") )

    -
    +

    diff --git a/reference/GT.opt_align_table_header.html b/reference/GT.opt_align_table_header.html index d4d3fe892..ed0584d54 100644 --- a/reference/GT.opt_align_table_header.html +++ b/reference/GT.opt_align_table_header.html @@ -231,7 +231,7 @@

    Re

    Examples

    Using select columns from the exibble dataset, let’s create a table with a number of components added. Following that, we’ll align the header contents (consisting of the title and the subtitle) to the left with the opt_align_table_header() method.

    -
    +
    from great_tables import GT, exibble, md
     
     (
    @@ -250,52 +250,52 @@ 

    .opt_align_table_header(align="left") )

    -
    +

    diff --git a/reference/GT.opt_all_caps.html b/reference/GT.opt_all_caps.html index af57ed1db..18d11e045 100644 --- a/reference/GT.opt_all_caps.html +++ b/reference/GT.opt_all_caps.html @@ -239,7 +239,7 @@

    Re

    Examples

    Using select columns from the exibble dataset, let’s create a table with a number of components added. Following that, we’ll ensure that all text in the column labels, the stub, and in all row groups is transformed to all caps using the opt_all_caps() method.

    -
    +
    from great_tables import GT, exibble, md
     
     (
    @@ -258,52 +258,52 @@ 

    .opt_all_caps() )

    -
    +

    diff --git a/reference/GT.opt_horizontal_padding.html b/reference/GT.opt_horizontal_padding.html index 802100a81..c3b8281ce 100644 --- a/reference/GT.opt_horizontal_padding.html +++ b/reference/GT.opt_horizontal_padding.html @@ -231,7 +231,7 @@

    Re

    Examples

    Using select columns from the exibble dataset, let’s create a table with a number of components added. Following that, we’ll scale the horizontal padding of the table by a factor of 3 using the opt_horizontal_padding() method.

    -
    +
    from great_tables import GT, exibble, md
     
     gt_tbl = (
    @@ -251,52 +251,52 @@ 

    gt_tbl.opt_horizontal_padding(scale=3)

    -
    +

    @@ -387,55 +387,55 @@

    The overall effect of scaling the horizontal padding is that the table will appear wider or and there will added buffer space between the table elements. The overall look of the table will be more spacious and neigboring pieces of text will be less cramped.

    Let’s go the other way and scale the horizontal padding of the table by a factor of 0.5 using the opt_horizontal_padding() method.

    -
    +
    gt_tbl.opt_horizontal_padding(scale=0.5)
    -
    +

    diff --git a/reference/GT.opt_row_striping.html b/reference/GT.opt_row_striping.html index 070ec3115..b9cf0b794 100644 --- a/reference/GT.opt_row_striping.html +++ b/reference/GT.opt_row_striping.html @@ -231,7 +231,7 @@

    Re

    Examples

    Using only a few columns from the exibble dataset, let’s create a table with a number of components added. Following that, we’ll add row striping to every second row with the opt_row_striping() method.

    -
    +
    from great_tables import GT, exibble, md
     
     (
    @@ -250,52 +250,52 @@ 

    .opt_row_striping() )

    -
    +

    diff --git a/reference/GT.opt_stylize.html b/reference/GT.opt_stylize.html index ad528ea9e..4b9e1f1b3 100644 --- a/reference/GT.opt_stylize.html +++ b/reference/GT.opt_stylize.html @@ -239,7 +239,7 @@

    Re

    Examples

    Using select columns from the exibble dataset, let’s create a table with a number of components added. Following that, we’ll apply a predefined style to the table using the opt_stylize() method.

    -
    +
    from great_tables import GT, exibble, md
     
     gt_tbl = (
    @@ -260,52 +260,52 @@ 

    gt_tbl

    -
    +

    @@ -396,55 +396,55 @@

    The table has been stylized with the default style and color. The default style is 1 and the default color is "blue". The resulting table style is a combination of color and border settings that are applied to the table.

    We can modify the overall style and choose a different color theme by providing different values to the style= and color= arguments.

    -
    +
    gt_tbl.opt_stylize(style=2, color="green")
    -
    +

    diff --git a/reference/GT.opt_table_font.html b/reference/GT.opt_table_font.html index f4e4a14d4..5ce375a57 100644 --- a/reference/GT.opt_table_font.html +++ b/reference/GT.opt_table_font.html @@ -276,7 +276,7 @@

    Examples

    Let’s use a subset of the sp500 dataset to create a small table. With opt_table_font() we can add some preferred font choices for modifying the text of the entire table. Here we’ll use the "Superclarendon" and "Georgia" fonts (the second font serves as a fallback).

    -
    +
    import polars as pl
     from great_tables import GT
     from great_tables.data import sp500
    @@ -289,52 +289,52 @@ 

    .opt_table_font(font=["Superclarendon", "Georgia"]) )

    -
    +
    @@ -430,7 +430,7 @@

    In practice, both of these fonts are not likely to be available on all systems. The opt_table_font() method safeguards against this by prepending the fonts in the font= list to the existing font stack. This way, if both fonts are not available, the table will fall back to using the list of default table fonts. This behavior is controlled by the add= argument, which is True by default.

    With the sza dataset we’ll create a two-column, eleven-row table. Within opt_table_font(), the stack= argument will be supplied with the “rounded-sans” font stack. This sets up a family of fonts with rounded, curved letterforms that should be locally available in different computing environments.

    -
    +
    from great_tables.data import sza
     
     sza_mini = (
    @@ -446,52 +446,52 @@ 

    .opt_all_caps() )

    -
    +

    diff --git a/reference/GT.opt_table_outline.html b/reference/GT.opt_table_outline.html index d88916627..2f7a7d51f 100644 --- a/reference/GT.opt_table_outline.html +++ b/reference/GT.opt_table_outline.html @@ -239,7 +239,7 @@

    Re

    Examples

    Using select columns from the exibble dataset, let’s create a table with a number of components added. Following that, we’ll put an outline around the entire table using the opt_table_outline() method.

    -
    +
    from great_tables import GT, exibble, md
     
     (
    @@ -258,52 +258,52 @@ 

    .opt_table_outline() )

    -
    +

    diff --git a/reference/GT.opt_vertical_padding.html b/reference/GT.opt_vertical_padding.html index d6548e053..677ba0390 100644 --- a/reference/GT.opt_vertical_padding.html +++ b/reference/GT.opt_vertical_padding.html @@ -231,7 +231,7 @@

    Re

    Examples

    Using select columns from the exibble dataset, let’s create a table with a number of components added. Following that, we’ll scale the vertical padding of the table by a factor of 3 using the opt_vertical_padding() method.

    -
    +
    from great_tables import GT, exibble, md
     
     gt_tbl = (
    @@ -251,52 +251,52 @@ 

    gt_tbl.opt_vertical_padding(scale=3)

    -
    +

    @@ -387,55 +387,55 @@

    Now that’s a tall table! The overall effect of scaling the vertical padding is that the table will appear taller and there will be more buffer space between the table elements. A value of 3 is pretty extreme and is likely to be too much in most cases, so, feel free to experiment with different values when looking to increase the vertical padding.

    Let’s go the other way (using a value less than 1) and try to condense the content vertically with a scale factor of 0.5. This will reduce the top and bottom padding globally and make the table appear more compact.

    -
    +
    gt_tbl.opt_vertical_padding(scale=0.5)
    -
    +

    diff --git a/reference/GT.pipe.html b/reference/GT.pipe.html index 64f628fb2..74f97c488 100644 --- a/reference/GT.pipe.html +++ b/reference/GT.pipe.html @@ -239,7 +239,7 @@

    Re

    Examples:

    Let’s use the name, land_area_km2, and density_2021 columns of the towny dataset to create a table. First, we’ll demonstrate using two consecutive calls to the .tab_style() method to highlight the maximum value of the land_area_km2 column with "lightgray" and the maximum value of the density_2021 column with "lightblue".

    -
    +
    import polars as pl
     from great_tables import GT, loc, style
     from great_tables.data import towny
    @@ -268,52 +268,52 @@ 

    ) )

    -
    +

    @@ -386,7 +386,7 @@

    Next, we’ll demonstrate how to achieve the same result using the .pipe() method to programmatically style each column.

    -
    +
    columns = ["land_area_km2", "density_2021"]
     colors = ["lightgray", "lightblue"]
     
    @@ -407,52 +407,52 @@ 

    ).pipe(tbl_style, columns, colors) )

    -
    +

    diff --git a/reference/GT.show.html b/reference/GT.show.html index 383821ac1..139172c47 100644 --- a/reference/GT.show.html +++ b/reference/GT.show.html @@ -221,58 +221,58 @@

    Examples

    The example below when in the Great Tables documentation, should appear on the page.

    -
    +
    from great_tables import GT, exibble
     
     GT(exibble.head(2)).show()
     GT(exibble.tail(2)).show()
    -
    +
    @@ -322,52 +322,52 @@

    -
    +

    diff --git a/reference/GT.sub_missing.html b/reference/GT.sub_missing.html index 5f356f94d..ce4bb5f66 100644 --- a/reference/GT.sub_missing.html +++ b/reference/GT.sub_missing.html @@ -239,7 +239,7 @@

    Re

    Examples

    Using a subset of the exibble dataset, let’s create a new table. The missing values in two selections of columns will be given different variations of replacement text (across two separate calls of sub_missing()).

    -
    +
    from great_tables import GT, md, html, exibble
     import polars as pl
     import polars.selectors as cs
    @@ -258,52 +258,52 @@ 

    ) )

    -
    +

    diff --git a/reference/GT.sub_zero.html b/reference/GT.sub_zero.html index 80cfe266a..06e163481 100644 --- a/reference/GT.sub_zero.html +++ b/reference/GT.sub_zero.html @@ -239,7 +239,7 @@

    Re

    Examples

    Let’s generate a simple table that contains an assortment of values that could potentially undergo some substitution via the sub_zero() method (i.e., there are two 0 values). The ordering of the fmt_scientific() and sub_zero() calls in the example below doesn’t affect the final result since any sub_*() method won’t interfere with the formatting of the table.

    -
    +
    from great_tables import GT
     import polars as pl
     
    @@ -252,52 +252,52 @@ 

    GT(single_vals_df).fmt_scientific(columns="numbers").sub_zero()

    -
    +

    diff --git a/reference/GT.tab_header.html b/reference/GT.tab_header.html index dca2da0ad..738d3d3cf 100644 --- a/reference/GT.tab_header.html +++ b/reference/GT.tab_header.html @@ -239,7 +239,7 @@

    Re

    Examples

    Let’s use a small portion of the gtcars dataset to create a table. A header part can be added to the table with the tab_header() method. We’ll add a title and the optional subtitle as well. With the md() helper function, we can make sure the Markdown formatting is interpreted and transformed.

    -
    +
    from great_tables import GT, md
     from great_tables.data import gtcars
     
    @@ -253,52 +253,52 @@ 

    ) )

    -
    +

    @@ -352,7 +352,7 @@

    We can alternatively use the html() helper function to retain HTML elements in the text.

    -
    +
    from great_tables import GT, md, html
     from great_tables.data import gtcars
     
    @@ -366,52 +366,52 @@ 

    ) )

    -
    +

    diff --git a/reference/GT.tab_options.html b/reference/GT.tab_options.html index 7e4bb7574..641930ada 100644 --- a/reference/GT.tab_options.html +++ b/reference/GT.tab_options.html @@ -831,7 +831,7 @@

    Re

    Examples

    Using select columns from the exibble dataset, let’s create a new table with a number of table components added. We can use this object going forward to demonstrate some of the features available in the tab_options() method.

    -
    +
    from great_tables import GT, exibble, md
     
     gt_tbl = (
    @@ -851,52 +851,52 @@ 

    gt_tbl

    -
    +

    @@ -986,55 +986,55 @@

    We can modify the table width to be set as "100%“. In effect, this spans the table to entirely fill the content width area. This is done with the table_width option.

    -
    +
    gt_tbl.tab_options(table_width="100%")
    -
    +

    @@ -1124,55 +1124,55 @@

    With the table_background_color option, we can modify the table’s background color. Here, we want that to be "lightcyan".

    -
    +
    gt_tbl.tab_options(table_background_color="lightcyan")
    -
    +

    @@ -1262,55 +1262,55 @@

    The data rows of a table typically take up the most physical space but we have some control over the extent of that. With the data_row_padding option, it’s possible to modify the top and bottom padding of data rows. We’ll do just that in the following example, reducing the padding to a value of "3px".

    -
    +
    gt_tbl.tab_options(data_row_padding="3px")
    -
    +

    @@ -1400,55 +1400,55 @@

    The size of the title and the subtitle text in the header of the table can be altered with the heading_title_font_size and heading_subtitle_font_size options. Here, we’ll use the "small" and "x-small" keyword values.

    -
    +
    gt_tbl.tab_options(heading_title_font_size="small", heading_subtitle_font_size="x-small")
    -
    +

    diff --git a/reference/GT.tab_source_note.html b/reference/GT.tab_source_note.html index 61cc0fb39..9f9f89636 100644 --- a/reference/GT.tab_source_note.html +++ b/reference/GT.tab_source_note.html @@ -231,7 +231,7 @@

    Re

    Examples

    With three columns from the gtcars dataset, let’s create a new table. We can use the tab_source_note() method to add a source note to the table footer. Here we are citing the data source but this method can be used for any text you’d prefer to display in the footer component of the table.

    -
    +
    from great_tables import GT
     from great_tables.data import gtcars
     
    @@ -242,52 +242,52 @@ 

    .tab_source_note(source_note="From edmunds.com") )

    -
    +

    diff --git a/reference/GT.tab_spanner.html b/reference/GT.tab_spanner.html index 18b44a90a..9b544b769 100644 --- a/reference/GT.tab_spanner.html +++ b/reference/GT.tab_spanner.html @@ -265,7 +265,7 @@

    Re

    Examples

    Let’s create a table using a small portion of the gtcars dataset. Over several columns (hp, hp_rpm, trq, trq_rpm, mpg_c, mpg_h) we’ll use tab_spanner() to add a spanner with the label "performance". This effectively groups together several columns related to car performance under a unifying label.

    -
    +
    from great_tables import GT
     from great_tables.data import gtcars
     
    @@ -280,52 +280,52 @@ 

    ) )

    -
    +

    @@ -447,7 +447,7 @@

    We can also use Markdown formatting for the spanner label. In this example, we’ll use gt.md("*Performance*") to make the label italicized.

    -
    +
    from great_tables import GT, md
     from great_tables.data import gtcars
     
    @@ -462,52 +462,52 @@ 

    ) )

    -
    +

    diff --git a/reference/GT.tab_stub.html b/reference/GT.tab_stub.html index a8dbc67d5..37a6918be 100644 --- a/reference/GT.tab_stub.html +++ b/reference/GT.tab_stub.html @@ -224,57 +224,57 @@

    Examples

    By default, all data is together in the body of the table.

    -
    +
    from great_tables import GT, exibble
     
     GT(exibble)
    -
    +
    @@ -391,55 +391,55 @@

    The table stub separates row names with a vertical line, and puts group names on their own line.

    -
    +
    GT(exibble).tab_stub(rowname_col="row", groupname_col="group")
    -
    +

    diff --git a/reference/GT.tab_stubhead.html b/reference/GT.tab_stubhead.html index 2dd93e489..06fa43b39 100644 --- a/reference/GT.tab_stubhead.html +++ b/reference/GT.tab_stubhead.html @@ -231,7 +231,7 @@

    Re

    Examples

    Using a small subset of the gtcars dataset, we can create a table with row labels. Since we have row labels in the stub (via use of rowname_col="model" in the GT() call) we have a stubhead, so, let’s add a stubhead label ("car") with the tab_stubhead() method to describe what’s in the stub.

    -
    +
    from great_tables import GT
     from great_tables.data import gtcars
     
    @@ -242,52 +242,52 @@ 

    .tab_stubhead(label="car") )

    -
    +

    @@ -341,7 +341,7 @@

    We can also use Markdown formatting for the stubhead label. In this example, we’ll use md("*Car*") to make the label italicized.

    -
    +
    from great_tables import GT, md
     from great_tables.data import gtcars
     
    @@ -350,52 +350,52 @@ 

    .tab_stubhead(label=md("*Car*")) )

    -
    +

    diff --git a/reference/GT.tab_style.html b/reference/GT.tab_style.html index ffa0b500a..e96ea2eba 100644 --- a/reference/GT.tab_style.html +++ b/reference/GT.tab_style.html @@ -243,7 +243,7 @@

    Re

    Examples

    Let’s use a small subset of the exibble dataset to demonstrate how to use tab_style() to target specific cells and apply styles to them. We’ll start by creating the exibble_sm table (a subset of the exibble table) and then use tab_style() to apply a light cyan background color to the cells in the num column for the first two rows of the table. We’ll then apply a larger font size to the cells in the fctr column for the last four rows of the table.

    -
    +
    from great_tables import GT, style, loc, exibble
     
     exibble_sm = exibble[["num", "fctr", "row", "group"]]
    @@ -260,52 +260,52 @@ 

    ) )

    -
    +

    @@ -374,7 +374,7 @@

    Let’s use exibble once again to create a simple, two-column output table (keeping only the num and currency columns). With the tab_style() method (called thrice), we’ll add style to the values already formatted by fmt_number() and fmt_currency(). In the style argument of the first two tab_style() call, we can define multiple types of styling with the style.fill() and style.text() classes (enclosing these in a list). The cells to be targeted for styling require the use of loc.body(), which is used here with different columns being targeted. For the final tab_style() call, we demonstrate the use of style.borders() class as the style argument, which is employed in conjunction with loc.body() to locate the row to be styled.

    -
    +
    from great_tables import GT, style, loc, exibble
     
     (
    @@ -401,52 +401,52 @@ 

    ) )

    -
    +

    diff --git a/reference/define_units.html b/reference/define_units.html index 4d98aec7e..3e7bb98c9 100644 --- a/reference/define_units.html +++ b/reference/define_units.html @@ -230,54 +230,54 @@

    Re

    Specification of units notation

    The following table demonstrates the various ways in which units can be specified in the units_notation string and how the input is processed by the define_units() function. The concluding step for display of the units in HTML is to use the to_html() method.

    -
    +
    -
    +

    diff --git a/reference/from_column.html b/reference/from_column.html index d1fb5860c..90e269b43 100644 --- a/reference/from_column.html +++ b/reference/from_column.html @@ -209,7 +209,7 @@

    from_column

    Specify that a style value should be fetched from a column in the data.

    Examples

    -
    +
    import pandas as pd
     from great_tables import GT, exibble, from_column, loc, style
     
    @@ -223,52 +223,52 @@ 

    ) )

    -
    +
    @@ -298,7 +298,7 @@

    If you are using polars, you can just pass polars expressions in directly:

    -
    +
    import polars as pl
     from great_tables import GT, exibble, from_column, loc, style
     
    @@ -312,52 +312,52 @@ 

    ) )

    -
    +

    diff --git a/reference/google_font.html b/reference/google_font.html index 561b8400c..ba924d26d 100644 --- a/reference/google_font.html +++ b/reference/google_font.html @@ -235,7 +235,7 @@

    Re

    Examples

    Let’s use the exibble dataset to create a table of two columns and eight rows. We’ll replace missing values with em dashes using sub_missing(). For text in the time column, we will use the font called "IBM Plex Mono" which is available from Google Fonts. This is defined inside the google_font() call, itself within the style.text() method that’s applied to the style= parameter of tab_style().

    -
    +
    from great_tables import GT, exibble, style, loc, google_font
     
     (
    @@ -247,53 +247,53 @@ 

    ) )

    -
    +

    @@ -347,7 +347,7 @@

    We can use a subset of the sp500 dataset to create a small table. With fmt_currency(), we can display values as monetary values. Then, we’ll set a larger font size for the table and opt to use the "Merriweather" font by calling google_font() within opt_table_font(). In cases where that font may not materialize, we include two font fallbacks: "Cochin" and the catchall "Serif" group.

    -
    +
    from great_tables import GT, google_font
     from great_tables.data import sp500
     
    @@ -358,53 +358,53 @@ 

    .opt_table_font(font=[google_font(name="Merriweather"), "Cochin", "Serif"]) )

    -
    +

    diff --git a/reference/loc.body.html b/reference/loc.body.html index 93d315dab..a4ff3af1f 100644 --- a/reference/loc.body.html +++ b/reference/loc.body.html @@ -235,7 +235,7 @@

    Re

    Examples

    Let’s use a subset of the gtcars dataset in a new table. We will style all of the body cells by using locations=loc.body() within tab_style().

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import gtcars
     
    @@ -257,52 +257,52 @@ 

    .fmt_currency(columns="msrp", decimals=0) )

    -
    +

    diff --git a/reference/loc.column_header.html b/reference/loc.column_header.html index 676e94680..8ebdbb0e8 100644 --- a/reference/loc.column_header.html +++ b/reference/loc.column_header.html @@ -221,7 +221,7 @@

    Re

    Examples

    Let’s use a subset of the gtcars dataset in a new table. We create spanner labels through use of the tab_spanner() method; this gives us a column header with a mix of column labels and spanner labels. We will style the entire column header at once by using locations=loc.column_header() within tab_style().

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import gtcars
     
    @@ -246,52 +246,52 @@ 

    .fmt_currency(columns="msrp", decimals=0) )

    -
    +

    diff --git a/reference/loc.column_labels.html b/reference/loc.column_labels.html index 71b6bfeb7..03cc704dd 100644 --- a/reference/loc.column_labels.html +++ b/reference/loc.column_labels.html @@ -231,7 +231,7 @@

    Re

    Examples

    Let’s use a subset of the gtcars dataset in a new table. We will style all three of the column labels by using locations=loc.column_labels() within tab_style(). Note that no specification of columns= is needed here because we want to target all columns.

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import gtcars
     
    @@ -243,52 +243,52 @@ 

    ) )

    -
    +

    diff --git a/reference/loc.footer.html b/reference/loc.footer.html index 7e945637d..8ec826faf 100644 --- a/reference/loc.footer.html +++ b/reference/loc.footer.html @@ -221,7 +221,7 @@

    Re

    Examples

    Let’s use a subset of the gtcars dataset in a new table. Add a source note (with tab_source_note() and style this footer section inside of tab_style() with locations=loc.footer().

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import gtcars
     
    @@ -234,52 +234,52 @@ 

    ) )

    -
    +

    diff --git a/reference/loc.header.html b/reference/loc.header.html index 34791e83d..a0d6a91d1 100644 --- a/reference/loc.header.html +++ b/reference/loc.header.html @@ -221,7 +221,7 @@

    Re

    Examples

    Let’s use a subset of the gtcars dataset in a new table. We will style the entire table header (the ‘title’ and ‘subtitle’ parts. This can be done by using locations=loc.header() within tab_style().

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import gtcars
     
    @@ -238,52 +238,52 @@ 

    .fmt_currency(columns="msrp", decimals=0) )

    -
    +

    diff --git a/reference/loc.row_groups.html b/reference/loc.row_groups.html index 4700c378e..4c248af4e 100644 --- a/reference/loc.row_groups.html +++ b/reference/loc.row_groups.html @@ -231,7 +231,7 @@

    Re

    Examples

    Let’s use a subset of the gtcars dataset in a new table. We will style all of the cells comprising the row group labels by using locations=loc.row_groups() within tab_style().

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import gtcars
     
    @@ -253,52 +253,52 @@ 

    .fmt_currency(columns="msrp", decimals=0) )

    -
    +

    diff --git a/reference/loc.source_notes.html b/reference/loc.source_notes.html index 4c79a4ba1..12f9ab6ee 100644 --- a/reference/loc.source_notes.html +++ b/reference/loc.source_notes.html @@ -221,7 +221,7 @@

    Re

    Examples

    Let’s use a subset of the gtcars dataset in a new table. Add a source note (with tab_source_note() and style the source notes section inside tab_style() with locations=loc.source_notes().

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import gtcars
     
    @@ -234,52 +234,52 @@ 

    ) )

    -
    +

    diff --git a/reference/loc.spanner_labels.html b/reference/loc.spanner_labels.html index f3bb6dc01..80302dee4 100644 --- a/reference/loc.spanner_labels.html +++ b/reference/loc.spanner_labels.html @@ -231,7 +231,7 @@

    Re

    Examples

    Let’s use a subset of the gtcars dataset in a new table. We create two spanner labels through two separate calls of the tab_spanner() method. In each of those, the text supplied to label= argument is used as the ID value (though they have to be explicitly set via the id= argument). We will style only the spanner label having the text "performance" by using locations=loc.spanner_labels(ids=["performance"]) within tab_style().

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import gtcars
     
    @@ -253,52 +253,52 @@ 

    .fmt_currency(columns="msrp", decimals=0) )

    -
    +

    diff --git a/reference/loc.stub.html b/reference/loc.stub.html index 3c76bd406..a45717162 100644 --- a/reference/loc.stub.html +++ b/reference/loc.stub.html @@ -231,7 +231,7 @@

    Re

    Examples

    Let’s use a subset of the gtcars dataset in a new table. We will style the entire table stub (the row labels) by using locations=loc.stub() within tab_style().

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import gtcars
     
    @@ -253,52 +253,52 @@ 

    .fmt_currency(columns="msrp", decimals=0) )

    -
    +

    diff --git a/reference/loc.stubhead.html b/reference/loc.stubhead.html index f403ce343..777d09b89 100644 --- a/reference/loc.stubhead.html +++ b/reference/loc.stubhead.html @@ -221,7 +221,7 @@

    Re

    Examples

    Let’s use a subset of the gtcars dataset in a new table. This table contains a stub (produced by setting rowname_col="model" in the initial GT() call). The stubhead is given a label by way of the tab_stubhead() method and this label can be styled by using locations=loc.stubhead() within tab_style().

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import gtcars
     
    @@ -240,52 +240,52 @@ 

    .fmt_currency(columns="msrp", decimals=0) )

    -
    +

    diff --git a/reference/loc.subtitle.html b/reference/loc.subtitle.html index 192414539..3de4abb6e 100644 --- a/reference/loc.subtitle.html +++ b/reference/loc.subtitle.html @@ -221,7 +221,7 @@

    Re

    Examples

    Let’s use a subset of the gtcars dataset in a new table. We will style only the ‘subtitle’ part of the table header (leaving the ‘title’ part unaffected). This can be done by using locations=loc.subtitle() within tab_style().

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import gtcars
     
    @@ -238,52 +238,52 @@ 

    .fmt_currency(columns="msrp", decimals=0) )

    -
    +

    diff --git a/reference/loc.title.html b/reference/loc.title.html index 8367b0b8f..9b0fbecbb 100644 --- a/reference/loc.title.html +++ b/reference/loc.title.html @@ -221,7 +221,7 @@

    Re

    Examples

    Let’s use a subset of the gtcars dataset in a new table. We will style only the ‘title’ part of the table header (leaving the ‘subtitle’ part unaffected). This can be done by using locations=loc.title() within tab_style().

    -
    +
    from great_tables import GT, style, loc
     from great_tables.data import gtcars
     
    @@ -238,52 +238,52 @@ 

    .fmt_currency(columns="msrp", decimals=0) )

    -
    +

    diff --git a/reference/system_fonts.html b/reference/system_fonts.html index 35ba6f776..24c9e99ee 100644 --- a/reference/system_fonts.html +++ b/reference/system_fonts.html @@ -327,7 +327,7 @@

    Handwritten (

    Examples

    Using select columns from the exibble dataset, let’s create a table with a number of components added. Following that, we’ll set a font for the entire table using the tab_options() method with the table_font_names parameter. Instead of passing a list of font names, we’ll use the system_fonts() helper function to get a font stack. In this case, we’ll use the "industrial" font stack.

    -
    +
    from great_tables import GT, exibble, md, system_fonts
     
     (
    @@ -347,52 +347,52 @@ 

    .tab_options(table_font_names=system_fonts("industrial")) )

    -
    +

    diff --git a/search.json b/search.json index 0f10983b9..9015ac56a 100644 --- a/search.json +++ b/search.json @@ -625,7 +625,7 @@ "href": "get-started/nanoplots.html#line-plots-with-paired-x-and-y-values", "title": "Nanoplots", "section": "Line plots with paired x and y values", - "text": "Line plots with paired x and y values\nAside from a single stream of y values, we can plot pairs of x and y values. This works only for the \"line\" type of plot. We can set up a column of Polars struct values in a DataFrame to have this input data prepared for fmt_nanoplot(). Notice that the dictionary values in the enclosed list must have the \"x\" and \"y\" keys. Further to this, the list lengths for each of \"x\" and \"y\" must match (i.e., to make valid pairs of x and y).\n\nweather_2 = pl.DataFrame(\n {\n \"station\": [\"Station \" + str(x) for x in range(1, 4)],\n \"temperatures\": [\n {\n \"x\": [6.1, 8.0, 10.1, 10.5, 11.2, 12.4, 13.1, 15.3],\n \"y\": [24.2, 28.2, 30.2, 30.5, 30.5, 33.1, 33.5, 32.7],\n },\n {\n \"x\": [7.1, 8.2, 10.3, 10.75, 11.25, 12.5, 13.5, 14.2],\n \"y\": [18.2, 18.1, 20.3, 20.5, 21.4, 21.9, 23.1, 23.3],\n },\n {\n \"x\": [6.3, 7.1, 10.3, 11.0, 12.07, 13.1, 15.12, 16.42],\n \"y\": [15.2, 17.77, 21.42, 21.63, 25.23, 26.84, 27.2, 27.44],\n },\n ]\n }\n)\n\n(\n GT(weather_2)\n .fmt_nanoplot(\n columns=\"temperatures\",\n plot_type=\"line\",\n expand_x=[5, 16],\n expand_y=[10, 40],\n options=nanoplot_options(\n show_data_area=False,\n show_data_line=False\n )\n )\n)\n\n\n---------------------------------------------------------------------------\nValueError Traceback (most recent call last)\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/IPython/core/formatters.py:344, in BaseFormatter.__call__(self, obj)\n 342 method = get_real_method(obj, self.print_method)\n 343 if method is not None:\n--> 344 return method()\n 345 return None\n 346 else:\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/gt.py:292, in GT._repr_html_(self)\n 289 make_page = defaults[\"make_page\"]\n 290 all_important = defaults[\"all_important\"]\n--> 292 rendered = self.as_raw_html(\n 293 make_page=make_page,\n 294 all_important=all_important,\n 295 )\n 297 return rendered\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/_export.py:220, in as_raw_html(self, inline_css, make_page, all_important)\n 130 def as_raw_html(\n 131 self: GT,\n 132 inline_css: bool = False,\n 133 make_page: bool = False,\n 134 all_important: bool = False,\n 135 ) -> str:\n 136 \"\"\"\n 137 Get the HTML content of a GT object.\n 138 \n (...)\n 218 ```\n 219 \"\"\"\n--> 220 built_table = self._build_data(context=\"html\")\n 222 if not inline_css:\n 223 html_table = built_table._render_as_html(\n 224 make_page=make_page,\n 225 all_important=all_important,\n 226 )\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/gt.py:310, in GT._build_data(self, context)\n 307 def _build_data(self, context: str) -> Self:\n 308 # Build the body of the table by generating a dictionary\n 309 # of lists with cells initially set to nan values\n--> 310 built = self._render_formats(context)\n 312 if context == \"latex\":\n 313 built = _migrate_unformatted_to_output(\n 314 data=built, data_tbl=self._tbl_data, formats=self._formats, context=context\n 315 )\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/gt.py:303, in GT._render_formats(self, context)\n 300 new_body = self._body.copy()\n 302 # TODO: this body method performs a mutation. Should we make a copy of body?\n--> 303 new_body.render_formats(self._tbl_data, self._formats, context)\n 304 new_body.render_formats(self._tbl_data, self._substitutions, context)\n 305 return self._replace(_body=new_body)\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/_gt_data.py:172, in Body.render_formats(self, data_tbl, formats, context)\n 170 raise Exception(\"Internal Error\")\n 171 for col, row in fmt.cells.resolve():\n--> 172 result = eval_func(_get_cell(data_tbl, row, col))\n 173 if isinstance(result, FormatterSkipElement):\n 174 continue\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/_formats.py:4712, in fmt_nanoplot.<locals>.fmt_nanoplot_fn(x, context, plot_type, plot_height, missing_vals, reference_line, reference_area, all_single_y_vals, options_plots)\n 4709 y_vals = x\n 4710 x_vals = None\n-> 4712 nanoplot = _generate_nanoplot(\n 4713 y_vals=y_vals,\n 4714 y_ref_line=reference_line,\n 4715 y_ref_area=reference_area,\n 4716 x_vals=x_vals,\n 4717 expand_x=expand_x,\n 4718 expand_y=expand_y,\n 4719 missing_vals=missing_vals,\n 4720 all_single_y_vals=all_single_y_vals,\n 4721 plot_type=plot_type,\n 4722 svg_height=plot_height,\n 4723 **options_plots,\n 4724 )\n 4726 return nanoplot\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/_utils_nanoplots.py:915, in _generate_nanoplot(y_vals, y_ref_line, y_ref_area, x_vals, expand_x, expand_y, missing_vals, all_y_vals, all_single_y_vals, plot_type, data_line_type, currency, y_val_fmt_fn, y_axis_fmt_fn, y_ref_line_fmt_fn, data_point_radius, data_point_stroke_color, data_point_stroke_width, data_point_fill_color, data_line_stroke_color, data_line_stroke_width, data_area_fill_color, data_bar_stroke_color, data_bar_stroke_width, data_bar_fill_color, data_bar_negative_stroke_color, data_bar_negative_stroke_width, data_bar_negative_fill_color, reference_line_color, reference_area_fill_color, vertical_guide_stroke_color, vertical_guide_stroke_width, show_data_points, show_data_line, show_data_area, show_reference_line, show_reference_area, show_vertical_guides, show_y_axis_guide, interactive_data_values, svg_height)\n 911 # If x values are present then normalize them between [0, 1]; if\n 912 # there are no x values, generate equally-spaced x values according\n 913 # to the number of y values\n 914 if plot_type == \"line\" and x_vals is not None:\n--> 915 if expand_x is not None and _val_is_str(expand_x):\n 916 # TODO: the line below lacked tests, and called non-existent methods.\n 917 # replace with something that doesn't use pandas and returns the correct thing.\n 918 \n 919 # Assume that string values are dates and convert them to timestamps\n 920 # expand_x = pd.to_datetime(expand_x, utc=True).timestamp()\n 921 raise NotImplementedError(\"Currently, passing expand_x as a string is unsupported.\")\n 923 # Scale to proportional values\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/_utils_nanoplots.py:41, in _val_is_str(x)\n 39 # If a list then signal a failure\n 40 if isinstance(x, list):\n---> 41 raise ValueError(\"The input cannot be a list. It must be a single value.\")\n 43 return isinstance(x, (str))\n\nValueError: The input cannot be a list. It must be a single value.\n\n\n\nGT(_tbl_data=shape: (3, 2)\n┌───────────┬─────────────────────────────────┐\n│ station ┆ temperatures │\n│ --- ┆ --- │\n│ str ┆ struct[2] │\n╞═══════════╪═════════════════════════════════╡\n│ Station 1 ┆ {[6.1, 8.0, … 15.3],[24.2, 28.… │\n│ Station 2 ┆ {[7.1, 8.2, … 14.2],[18.2, 18.… │\n│ Station 3 ┆ {[6.3, 7.1, … 16.42],[15.2, 17… │\n└───────────┴─────────────────────────────────┘, _body=<great_tables._gt_data.Body object at 0x7f6410303010>, _boxhead=Boxhead([ColInfo(var='station', type=<ColInfoTypeEnum.default: 1>, column_label='station', column_align='left', column_width=None), ColInfo(var='temperatures', type=<ColInfoTypeEnum.default: 1>, column_label='temperatures', column_align='center', column_width=None)]), _stub=<great_tables._gt_data.Stub object at 0x7f64103933a0>, _spanners=Spanners([]), _heading=Heading(title=None, subtitle=None, preheader=None), _stubhead=None, _source_notes=[], _footnotes=[], _styles=[], _locale=<great_tables._gt_data.Locale object at 0x7f6410392500>, _formats=[<great_tables._gt_data.FormatInfo object at 0x7f6410393220>], _substitutions=[], _options=Options(table_id=OptionsInfo(scss=False, category='table', type='value', value=None), table_caption=OptionsInfo(scss=False, category='table', type='value', value=None), table_width=OptionsInfo(scss=True, category='table', type='px', value='auto'), table_layout=OptionsInfo(scss=True, category='table', type='value', value='fixed'), table_margin_left=OptionsInfo(scss=True, category='table', type='px', value='auto'), table_margin_right=OptionsInfo(scss=True, category='table', type='px', value='auto'), table_background_color=OptionsInfo(scss=True, category='table', type='value', value='#FFFFFF'), table_additional_css=OptionsInfo(scss=False, category='table', type='values', value=[]), table_font_names=OptionsInfo(scss=False, category='table', type='values', value=['-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', 'Fira Sans', 'Droid Sans', 'Arial', 'sans-serif']), table_font_size=OptionsInfo(scss=True, category='table', type='px', value='16px'), table_font_weight=OptionsInfo(scss=True, category='table', type='value', value='normal'), table_font_style=OptionsInfo(scss=True, category='table', type='value', value='normal'), table_font_color=OptionsInfo(scss=True, category='table', type='value', value='#333333'), table_font_color_light=OptionsInfo(scss=True, category='table', type='value', value='#FFFFFF'), table_border_top_include=OptionsInfo(scss=False, category='table', type='boolean', value=True), table_border_top_style=OptionsInfo(scss=True, category='table', type='value', value='solid'), table_border_top_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_top_color=OptionsInfo(scss=True, category='table', type='value', value='#A8A8A8'), table_border_right_style=OptionsInfo(scss=True, category='table', type='value', value='none'), table_border_right_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_right_color=OptionsInfo(scss=True, category='table', type='value', value='#D3D3D3'), table_border_bottom_include=OptionsInfo(scss=False, category='table', type='boolean', value=True), table_border_bottom_style=OptionsInfo(scss=True, category='table', type='value', value='solid'), table_border_bottom_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_bottom_color=OptionsInfo(scss=True, category='table', type='value', value='#A8A8A8'), table_border_left_style=OptionsInfo(scss=True, category='table', type='value', value='none'), table_border_left_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_left_color=OptionsInfo(scss=True, category='table', type='value', value='#D3D3D3'), heading_background_color=OptionsInfo(scss=True, category='heading', type='value', value=None), heading_align=OptionsInfo(scss=True, category='heading', type='value', value='center'), heading_title_font_size=OptionsInfo(scss=True, category='heading', type='px', value='125%'), heading_title_font_weight=OptionsInfo(scss=True, category='heading', type='value', value='initial'), heading_subtitle_font_size=OptionsInfo(scss=True, category='heading', type='px', value='85%'), heading_subtitle_font_weight=OptionsInfo(scss=True, category='heading', type='value', value='initial'), heading_padding=OptionsInfo(scss=True, category='heading', type='px', value='4px'), heading_padding_horizontal=OptionsInfo(scss=True, category='heading', type='px', value='5px'), heading_border_bottom_style=OptionsInfo(scss=True, category='heading', type='value', value='solid'), heading_border_bottom_width=OptionsInfo(scss=True, category='heading', type='px', value='2px'), heading_border_bottom_color=OptionsInfo(scss=True, category='heading', type='value', value='#D3D3D3'), heading_border_lr_style=OptionsInfo(scss=True, category='heading', type='value', value='none'), heading_border_lr_width=OptionsInfo(scss=True, category='heading', type='px', value='1px'), heading_border_lr_color=OptionsInfo(scss=True, category='heading', type='value', value='#D3D3D3'), column_labels_background_color=OptionsInfo(scss=True, category='column_labels', type='value', value=None), column_labels_font_size=OptionsInfo(scss=True, category='column_labels', type='px', value='100%'), column_labels_font_weight=OptionsInfo(scss=True, category='column_labels', type='value', value='normal'), column_labels_text_transform=OptionsInfo(scss=True, category='column_labels', type='value', value='inherit'), column_labels_padding=OptionsInfo(scss=True, category='column_labels', type='px', value='5px'), column_labels_padding_horizontal=OptionsInfo(scss=True, category='column_labels', type='px', value='5px'), column_labels_vlines_style=OptionsInfo(scss=True, category='table_body', type='value', value='none'), column_labels_vlines_width=OptionsInfo(scss=True, category='table_body', type='px', value='1px'), column_labels_vlines_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), column_labels_border_top_style=OptionsInfo(scss=True, category='column_labels', type='value', value='solid'), column_labels_border_top_width=OptionsInfo(scss=True, category='column_labels', type='px', value='2px'), column_labels_border_top_color=OptionsInfo(scss=True, category='column_labels', type='value', value='#D3D3D3'), column_labels_border_bottom_style=OptionsInfo(scss=True, category='column_labels', type='value', value='solid'), column_labels_border_bottom_width=OptionsInfo(scss=True, category='column_labels', type='px', value='2px'), column_labels_border_bottom_color=OptionsInfo(scss=True, category='column_labels', type='value', value='#D3D3D3'), column_labels_border_lr_style=OptionsInfo(scss=True, category='column_labels', type='value', value='none'), column_labels_border_lr_width=OptionsInfo(scss=True, category='column_labels', type='px', value='1px'), column_labels_border_lr_color=OptionsInfo(scss=True, category='column_labels', type='value', value='#D3D3D3'), column_labels_hidden=OptionsInfo(scss=False, category='column_labels', type='boolean', value=False), row_group_background_color=OptionsInfo(scss=True, category='row_group', type='value', value=None), row_group_font_size=OptionsInfo(scss=True, category='row_group', type='px', value='100%'), row_group_font_weight=OptionsInfo(scss=True, category='row_group', type='value', value='initial'), row_group_text_transform=OptionsInfo(scss=True, category='row_group', type='value', value='inherit'), row_group_padding=OptionsInfo(scss=True, category='row_group', type='px', value='8px'), row_group_padding_horizontal=OptionsInfo(scss=True, category='row_group', type='px', value='5px'), row_group_border_top_style=OptionsInfo(scss=True, category='row_group', type='value', value='solid'), row_group_border_top_width=OptionsInfo(scss=True, category='row_group', type='px', value='2px'), row_group_border_top_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_border_right_style=OptionsInfo(scss=True, category='row_group', type='value', value='none'), row_group_border_right_width=OptionsInfo(scss=True, category='row_group', type='px', value='1px'), row_group_border_right_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_border_bottom_style=OptionsInfo(scss=True, category='row_group', type='value', value='solid'), row_group_border_bottom_width=OptionsInfo(scss=True, category='row_group', type='px', value='2px'), row_group_border_bottom_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_border_left_style=OptionsInfo(scss=True, category='row_group', type='value', value='none'), row_group_border_left_width=OptionsInfo(scss=True, category='row_group', type='px', value='1px'), row_group_border_left_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_as_column=OptionsInfo(scss=False, category='row_group', type='boolean', value=False), table_body_hlines_style=OptionsInfo(scss=True, category='table_body', type='value', value='solid'), table_body_hlines_width=OptionsInfo(scss=True, category='table_body', type='px', value='1px'), table_body_hlines_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), table_body_vlines_style=OptionsInfo(scss=True, category='table_body', type='value', value='none'), table_body_vlines_width=OptionsInfo(scss=True, category='table_body', type='px', value='1px'), table_body_vlines_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), table_body_border_top_style=OptionsInfo(scss=True, category='table_body', type='value', value='solid'), table_body_border_top_width=OptionsInfo(scss=True, category='table_body', type='px', value='2px'), table_body_border_top_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), table_body_border_bottom_style=OptionsInfo(scss=True, category='table_body', type='value', value='solid'), table_body_border_bottom_width=OptionsInfo(scss=True, category='table_body', type='px', value='2px'), table_body_border_bottom_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), data_row_padding=OptionsInfo(scss=True, category='data_row', type='px', value='8px'), data_row_padding_horizontal=OptionsInfo(scss=True, category='data_row', type='px', value='5px'), stub_background_color=OptionsInfo(scss=True, category='stub', type='value', value=None), stub_font_size=OptionsInfo(scss=True, category='stub', type='px', value='100%'), stub_font_weight=OptionsInfo(scss=True, category='stub', type='value', value='initial'), stub_text_transform=OptionsInfo(scss=True, category='stub', type='value', value='inherit'), stub_border_style=OptionsInfo(scss=True, category='stub', type='value', value='solid'), stub_border_width=OptionsInfo(scss=True, category='stub', type='px', value='2px'), stub_border_color=OptionsInfo(scss=True, category='stub', type='value', value='#D3D3D3'), stub_row_group_background_color=OptionsInfo(scss=True, category='stub', type='value', value=None), stub_row_group_font_size=OptionsInfo(scss=True, category='stub', type='px', value='100%'), stub_row_group_font_weight=OptionsInfo(scss=True, category='stub', type='value', value='initial'), stub_row_group_text_transform=OptionsInfo(scss=True, category='stub', type='value', value='inherit'), stub_row_group_border_style=OptionsInfo(scss=True, category='stub', type='value', value='solid'), stub_row_group_border_width=OptionsInfo(scss=True, category='stub', type='px', value='2px'), stub_row_group_border_color=OptionsInfo(scss=True, category='stub', type='value', value='#D3D3D3'), source_notes_padding=OptionsInfo(scss=True, category='source_notes', type='px', value='4px'), source_notes_padding_horizontal=OptionsInfo(scss=True, category='source_notes', type='px', value='5px'), source_notes_background_color=OptionsInfo(scss=True, category='source_notes', type='value', value=None), source_notes_font_size=OptionsInfo(scss=True, category='source_notes', type='px', value='90%'), source_notes_border_bottom_style=OptionsInfo(scss=True, category='source_notes', type='value', value='none'), source_notes_border_bottom_width=OptionsInfo(scss=True, category='source_notes', type='px', value='2px'), source_notes_border_bottom_color=OptionsInfo(scss=True, category='source_notes', type='value', value='#D3D3D3'), source_notes_border_lr_style=OptionsInfo(scss=True, category='source_notes', type='value', value='none'), source_notes_border_lr_width=OptionsInfo(scss=True, category='source_notes', type='px', value='2px'), source_notes_border_lr_color=OptionsInfo(scss=True, category='source_notes', type='value', value='#D3D3D3'), source_notes_multiline=OptionsInfo(scss=False, category='source_notes', type='boolean', value=True), source_notes_sep=OptionsInfo(scss=False, category='source_notes', type='value', value=' '), row_striping_background_color=OptionsInfo(scss=True, category='row', type='value', value='rgba(128,128,128,0.05)'), row_striping_include_stub=OptionsInfo(scss=False, category='row', type='boolean', value=False), row_striping_include_table_body=OptionsInfo(scss=False, category='row', type='boolean', value=False), container_width=OptionsInfo(scss=False, category='container', type='px', value='auto'), container_height=OptionsInfo(scss=False, category='container', type='px', value='auto'), container_padding_x=OptionsInfo(scss=False, category='container', type='px', value='0px'), container_padding_y=OptionsInfo(scss=False, category='container', type='px', value='10px'), container_overflow_x=OptionsInfo(scss=False, category='container', type='overflow', value='auto'), container_overflow_y=OptionsInfo(scss=False, category='container', type='overflow', value='auto'), quarto_disable_processing=OptionsInfo(scss=False, category='quarto', type='logical', value=False), quarto_use_bootstrap=OptionsInfo(scss=False, category='quarto', type='logical', value=False)), _has_built=False)\n\n\nThe options for removing the data area and the data line (though the corresponding show_* arguments of nanoplot_options()) make the finalized nanoplots look somewhat like scatter plots.", + "text": "Line plots with paired x and y values\nAside from a single stream of y values, we can plot pairs of x and y values. This works only for the \"line\" type of plot. We can set up a column of Polars struct values in a DataFrame to have this input data prepared for fmt_nanoplot(). Notice that the dictionary values in the enclosed list must have the \"x\" and \"y\" keys. Further to this, the list lengths for each of \"x\" and \"y\" must match (i.e., to make valid pairs of x and y).\n\nweather_2 = pl.DataFrame(\n {\n \"station\": [\"Station \" + str(x) for x in range(1, 4)],\n \"temperatures\": [\n {\n \"x\": [6.1, 8.0, 10.1, 10.5, 11.2, 12.4, 13.1, 15.3],\n \"y\": [24.2, 28.2, 30.2, 30.5, 30.5, 33.1, 33.5, 32.7],\n },\n {\n \"x\": [7.1, 8.2, 10.3, 10.75, 11.25, 12.5, 13.5, 14.2],\n \"y\": [18.2, 18.1, 20.3, 20.5, 21.4, 21.9, 23.1, 23.3],\n },\n {\n \"x\": [6.3, 7.1, 10.3, 11.0, 12.07, 13.1, 15.12, 16.42],\n \"y\": [15.2, 17.77, 21.42, 21.63, 25.23, 26.84, 27.2, 27.44],\n },\n ]\n }\n)\n\n(\n GT(weather_2)\n .fmt_nanoplot(\n columns=\"temperatures\",\n plot_type=\"line\",\n expand_x=[5, 16],\n expand_y=[10, 40],\n options=nanoplot_options(\n show_data_area=False,\n show_data_line=False\n )\n )\n)\n\n\n---------------------------------------------------------------------------\nValueError Traceback (most recent call last)\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/IPython/core/formatters.py:344, in BaseFormatter.__call__(self, obj)\n 342 method = get_real_method(obj, self.print_method)\n 343 if method is not None:\n--> 344 return method()\n 345 return None\n 346 else:\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/gt.py:292, in GT._repr_html_(self)\n 289 make_page = defaults[\"make_page\"]\n 290 all_important = defaults[\"all_important\"]\n--> 292 rendered = self.as_raw_html(\n 293 make_page=make_page,\n 294 all_important=all_important,\n 295 )\n 297 return rendered\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/_export.py:220, in as_raw_html(self, inline_css, make_page, all_important)\n 130 def as_raw_html(\n 131 self: GT,\n 132 inline_css: bool = False,\n 133 make_page: bool = False,\n 134 all_important: bool = False,\n 135 ) -> str:\n 136 \"\"\"\n 137 Get the HTML content of a GT object.\n 138 \n (...)\n 218 ```\n 219 \"\"\"\n--> 220 built_table = self._build_data(context=\"html\")\n 222 if not inline_css:\n 223 html_table = built_table._render_as_html(\n 224 make_page=make_page,\n 225 all_important=all_important,\n 226 )\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/gt.py:310, in GT._build_data(self, context)\n 307 def _build_data(self, context: str) -> Self:\n 308 # Build the body of the table by generating a dictionary\n 309 # of lists with cells initially set to nan values\n--> 310 built = self._render_formats(context)\n 312 if context == \"latex\":\n 313 built = _migrate_unformatted_to_output(\n 314 data=built, data_tbl=self._tbl_data, formats=self._formats, context=context\n 315 )\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/gt.py:303, in GT._render_formats(self, context)\n 300 new_body = self._body.copy()\n 302 # TODO: this body method performs a mutation. Should we make a copy of body?\n--> 303 new_body.render_formats(self._tbl_data, self._formats, context)\n 304 new_body.render_formats(self._tbl_data, self._substitutions, context)\n 305 return self._replace(_body=new_body)\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/_gt_data.py:172, in Body.render_formats(self, data_tbl, formats, context)\n 170 raise Exception(\"Internal Error\")\n 171 for col, row in fmt.cells.resolve():\n--> 172 result = eval_func(_get_cell(data_tbl, row, col))\n 173 if isinstance(result, FormatterSkipElement):\n 174 continue\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/_formats.py:4712, in fmt_nanoplot.<locals>.fmt_nanoplot_fn(x, context, plot_type, plot_height, missing_vals, reference_line, reference_area, all_single_y_vals, options_plots)\n 4709 y_vals = x\n 4710 x_vals = None\n-> 4712 nanoplot = _generate_nanoplot(\n 4713 y_vals=y_vals,\n 4714 y_ref_line=reference_line,\n 4715 y_ref_area=reference_area,\n 4716 x_vals=x_vals,\n 4717 expand_x=expand_x,\n 4718 expand_y=expand_y,\n 4719 missing_vals=missing_vals,\n 4720 all_single_y_vals=all_single_y_vals,\n 4721 plot_type=plot_type,\n 4722 svg_height=plot_height,\n 4723 **options_plots,\n 4724 )\n 4726 return nanoplot\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/_utils_nanoplots.py:915, in _generate_nanoplot(y_vals, y_ref_line, y_ref_area, x_vals, expand_x, expand_y, missing_vals, all_y_vals, all_single_y_vals, plot_type, data_line_type, currency, y_val_fmt_fn, y_axis_fmt_fn, y_ref_line_fmt_fn, data_point_radius, data_point_stroke_color, data_point_stroke_width, data_point_fill_color, data_line_stroke_color, data_line_stroke_width, data_area_fill_color, data_bar_stroke_color, data_bar_stroke_width, data_bar_fill_color, data_bar_negative_stroke_color, data_bar_negative_stroke_width, data_bar_negative_fill_color, reference_line_color, reference_area_fill_color, vertical_guide_stroke_color, vertical_guide_stroke_width, show_data_points, show_data_line, show_data_area, show_reference_line, show_reference_area, show_vertical_guides, show_y_axis_guide, interactive_data_values, svg_height)\n 911 # If x values are present then normalize them between [0, 1]; if\n 912 # there are no x values, generate equally-spaced x values according\n 913 # to the number of y values\n 914 if plot_type == \"line\" and x_vals is not None:\n--> 915 if expand_x is not None and _val_is_str(expand_x):\n 916 # TODO: the line below lacked tests, and called non-existent methods.\n 917 # replace with something that doesn't use pandas and returns the correct thing.\n 918 \n 919 # Assume that string values are dates and convert them to timestamps\n 920 # expand_x = pd.to_datetime(expand_x, utc=True).timestamp()\n 921 raise NotImplementedError(\"Currently, passing expand_x as a string is unsupported.\")\n 923 # Scale to proportional values\n\nFile /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/great_tables/_utils_nanoplots.py:41, in _val_is_str(x)\n 39 # If a list then signal a failure\n 40 if isinstance(x, list):\n---> 41 raise ValueError(\"The input cannot be a list. It must be a single value.\")\n 43 return isinstance(x, (str))\n\nValueError: The input cannot be a list. It must be a single value.\n\n\n\nGT(_tbl_data=shape: (3, 2)\n┌───────────┬─────────────────────────────────┐\n│ station ┆ temperatures │\n│ --- ┆ --- │\n│ str ┆ struct[2] │\n╞═══════════╪═════════════════════════════════╡\n│ Station 1 ┆ {[6.1, 8.0, … 15.3],[24.2, 28.… │\n│ Station 2 ┆ {[7.1, 8.2, … 14.2],[18.2, 18.… │\n│ Station 3 ┆ {[6.3, 7.1, … 16.42],[15.2, 17… │\n└───────────┴─────────────────────────────────┘, _body=<great_tables._gt_data.Body object at 0x7f6e3501c3d0>, _boxhead=Boxhead([ColInfo(var='station', type=<ColInfoTypeEnum.default: 1>, column_label='station', column_align='left', column_width=None), ColInfo(var='temperatures', type=<ColInfoTypeEnum.default: 1>, column_label='temperatures', column_align='center', column_width=None)]), _stub=<great_tables._gt_data.Stub object at 0x7f6df809ee30>, _spanners=Spanners([]), _heading=Heading(title=None, subtitle=None, preheader=None), _stubhead=None, _source_notes=[], _footnotes=[], _styles=[], _locale=<great_tables._gt_data.Locale object at 0x7f6df809d6c0>, _formats=[<great_tables._gt_data.FormatInfo object at 0x7f6df80ca800>], _substitutions=[], _options=Options(table_id=OptionsInfo(scss=False, category='table', type='value', value=None), table_caption=OptionsInfo(scss=False, category='table', type='value', value=None), table_width=OptionsInfo(scss=True, category='table', type='px', value='auto'), table_layout=OptionsInfo(scss=True, category='table', type='value', value='fixed'), table_margin_left=OptionsInfo(scss=True, category='table', type='px', value='auto'), table_margin_right=OptionsInfo(scss=True, category='table', type='px', value='auto'), table_background_color=OptionsInfo(scss=True, category='table', type='value', value='#FFFFFF'), table_additional_css=OptionsInfo(scss=False, category='table', type='values', value=[]), table_font_names=OptionsInfo(scss=False, category='table', type='values', value=['-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', 'Fira Sans', 'Droid Sans', 'Arial', 'sans-serif']), table_font_size=OptionsInfo(scss=True, category='table', type='px', value='16px'), table_font_weight=OptionsInfo(scss=True, category='table', type='value', value='normal'), table_font_style=OptionsInfo(scss=True, category='table', type='value', value='normal'), table_font_color=OptionsInfo(scss=True, category='table', type='value', value='#333333'), table_font_color_light=OptionsInfo(scss=True, category='table', type='value', value='#FFFFFF'), table_border_top_include=OptionsInfo(scss=False, category='table', type='boolean', value=True), table_border_top_style=OptionsInfo(scss=True, category='table', type='value', value='solid'), table_border_top_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_top_color=OptionsInfo(scss=True, category='table', type='value', value='#A8A8A8'), table_border_right_style=OptionsInfo(scss=True, category='table', type='value', value='none'), table_border_right_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_right_color=OptionsInfo(scss=True, category='table', type='value', value='#D3D3D3'), table_border_bottom_include=OptionsInfo(scss=False, category='table', type='boolean', value=True), table_border_bottom_style=OptionsInfo(scss=True, category='table', type='value', value='solid'), table_border_bottom_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_bottom_color=OptionsInfo(scss=True, category='table', type='value', value='#A8A8A8'), table_border_left_style=OptionsInfo(scss=True, category='table', type='value', value='none'), table_border_left_width=OptionsInfo(scss=True, category='table', type='px', value='2px'), table_border_left_color=OptionsInfo(scss=True, category='table', type='value', value='#D3D3D3'), heading_background_color=OptionsInfo(scss=True, category='heading', type='value', value=None), heading_align=OptionsInfo(scss=True, category='heading', type='value', value='center'), heading_title_font_size=OptionsInfo(scss=True, category='heading', type='px', value='125%'), heading_title_font_weight=OptionsInfo(scss=True, category='heading', type='value', value='initial'), heading_subtitle_font_size=OptionsInfo(scss=True, category='heading', type='px', value='85%'), heading_subtitle_font_weight=OptionsInfo(scss=True, category='heading', type='value', value='initial'), heading_padding=OptionsInfo(scss=True, category='heading', type='px', value='4px'), heading_padding_horizontal=OptionsInfo(scss=True, category='heading', type='px', value='5px'), heading_border_bottom_style=OptionsInfo(scss=True, category='heading', type='value', value='solid'), heading_border_bottom_width=OptionsInfo(scss=True, category='heading', type='px', value='2px'), heading_border_bottom_color=OptionsInfo(scss=True, category='heading', type='value', value='#D3D3D3'), heading_border_lr_style=OptionsInfo(scss=True, category='heading', type='value', value='none'), heading_border_lr_width=OptionsInfo(scss=True, category='heading', type='px', value='1px'), heading_border_lr_color=OptionsInfo(scss=True, category='heading', type='value', value='#D3D3D3'), column_labels_background_color=OptionsInfo(scss=True, category='column_labels', type='value', value=None), column_labels_font_size=OptionsInfo(scss=True, category='column_labels', type='px', value='100%'), column_labels_font_weight=OptionsInfo(scss=True, category='column_labels', type='value', value='normal'), column_labels_text_transform=OptionsInfo(scss=True, category='column_labels', type='value', value='inherit'), column_labels_padding=OptionsInfo(scss=True, category='column_labels', type='px', value='5px'), column_labels_padding_horizontal=OptionsInfo(scss=True, category='column_labels', type='px', value='5px'), column_labels_vlines_style=OptionsInfo(scss=True, category='table_body', type='value', value='none'), column_labels_vlines_width=OptionsInfo(scss=True, category='table_body', type='px', value='1px'), column_labels_vlines_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), column_labels_border_top_style=OptionsInfo(scss=True, category='column_labels', type='value', value='solid'), column_labels_border_top_width=OptionsInfo(scss=True, category='column_labels', type='px', value='2px'), column_labels_border_top_color=OptionsInfo(scss=True, category='column_labels', type='value', value='#D3D3D3'), column_labels_border_bottom_style=OptionsInfo(scss=True, category='column_labels', type='value', value='solid'), column_labels_border_bottom_width=OptionsInfo(scss=True, category='column_labels', type='px', value='2px'), column_labels_border_bottom_color=OptionsInfo(scss=True, category='column_labels', type='value', value='#D3D3D3'), column_labels_border_lr_style=OptionsInfo(scss=True, category='column_labels', type='value', value='none'), column_labels_border_lr_width=OptionsInfo(scss=True, category='column_labels', type='px', value='1px'), column_labels_border_lr_color=OptionsInfo(scss=True, category='column_labels', type='value', value='#D3D3D3'), column_labels_hidden=OptionsInfo(scss=False, category='column_labels', type='boolean', value=False), row_group_background_color=OptionsInfo(scss=True, category='row_group', type='value', value=None), row_group_font_size=OptionsInfo(scss=True, category='row_group', type='px', value='100%'), row_group_font_weight=OptionsInfo(scss=True, category='row_group', type='value', value='initial'), row_group_text_transform=OptionsInfo(scss=True, category='row_group', type='value', value='inherit'), row_group_padding=OptionsInfo(scss=True, category='row_group', type='px', value='8px'), row_group_padding_horizontal=OptionsInfo(scss=True, category='row_group', type='px', value='5px'), row_group_border_top_style=OptionsInfo(scss=True, category='row_group', type='value', value='solid'), row_group_border_top_width=OptionsInfo(scss=True, category='row_group', type='px', value='2px'), row_group_border_top_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_border_right_style=OptionsInfo(scss=True, category='row_group', type='value', value='none'), row_group_border_right_width=OptionsInfo(scss=True, category='row_group', type='px', value='1px'), row_group_border_right_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_border_bottom_style=OptionsInfo(scss=True, category='row_group', type='value', value='solid'), row_group_border_bottom_width=OptionsInfo(scss=True, category='row_group', type='px', value='2px'), row_group_border_bottom_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_border_left_style=OptionsInfo(scss=True, category='row_group', type='value', value='none'), row_group_border_left_width=OptionsInfo(scss=True, category='row_group', type='px', value='1px'), row_group_border_left_color=OptionsInfo(scss=True, category='row_group', type='value', value='#D3D3D3'), row_group_as_column=OptionsInfo(scss=False, category='row_group', type='boolean', value=False), table_body_hlines_style=OptionsInfo(scss=True, category='table_body', type='value', value='solid'), table_body_hlines_width=OptionsInfo(scss=True, category='table_body', type='px', value='1px'), table_body_hlines_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), table_body_vlines_style=OptionsInfo(scss=True, category='table_body', type='value', value='none'), table_body_vlines_width=OptionsInfo(scss=True, category='table_body', type='px', value='1px'), table_body_vlines_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), table_body_border_top_style=OptionsInfo(scss=True, category='table_body', type='value', value='solid'), table_body_border_top_width=OptionsInfo(scss=True, category='table_body', type='px', value='2px'), table_body_border_top_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), table_body_border_bottom_style=OptionsInfo(scss=True, category='table_body', type='value', value='solid'), table_body_border_bottom_width=OptionsInfo(scss=True, category='table_body', type='px', value='2px'), table_body_border_bottom_color=OptionsInfo(scss=True, category='table_body', type='value', value='#D3D3D3'), data_row_padding=OptionsInfo(scss=True, category='data_row', type='px', value='8px'), data_row_padding_horizontal=OptionsInfo(scss=True, category='data_row', type='px', value='5px'), stub_background_color=OptionsInfo(scss=True, category='stub', type='value', value=None), stub_font_size=OptionsInfo(scss=True, category='stub', type='px', value='100%'), stub_font_weight=OptionsInfo(scss=True, category='stub', type='value', value='initial'), stub_text_transform=OptionsInfo(scss=True, category='stub', type='value', value='inherit'), stub_border_style=OptionsInfo(scss=True, category='stub', type='value', value='solid'), stub_border_width=OptionsInfo(scss=True, category='stub', type='px', value='2px'), stub_border_color=OptionsInfo(scss=True, category='stub', type='value', value='#D3D3D3'), stub_row_group_background_color=OptionsInfo(scss=True, category='stub', type='value', value=None), stub_row_group_font_size=OptionsInfo(scss=True, category='stub', type='px', value='100%'), stub_row_group_font_weight=OptionsInfo(scss=True, category='stub', type='value', value='initial'), stub_row_group_text_transform=OptionsInfo(scss=True, category='stub', type='value', value='inherit'), stub_row_group_border_style=OptionsInfo(scss=True, category='stub', type='value', value='solid'), stub_row_group_border_width=OptionsInfo(scss=True, category='stub', type='px', value='2px'), stub_row_group_border_color=OptionsInfo(scss=True, category='stub', type='value', value='#D3D3D3'), source_notes_padding=OptionsInfo(scss=True, category='source_notes', type='px', value='4px'), source_notes_padding_horizontal=OptionsInfo(scss=True, category='source_notes', type='px', value='5px'), source_notes_background_color=OptionsInfo(scss=True, category='source_notes', type='value', value=None), source_notes_font_size=OptionsInfo(scss=True, category='source_notes', type='px', value='90%'), source_notes_border_bottom_style=OptionsInfo(scss=True, category='source_notes', type='value', value='none'), source_notes_border_bottom_width=OptionsInfo(scss=True, category='source_notes', type='px', value='2px'), source_notes_border_bottom_color=OptionsInfo(scss=True, category='source_notes', type='value', value='#D3D3D3'), source_notes_border_lr_style=OptionsInfo(scss=True, category='source_notes', type='value', value='none'), source_notes_border_lr_width=OptionsInfo(scss=True, category='source_notes', type='px', value='2px'), source_notes_border_lr_color=OptionsInfo(scss=True, category='source_notes', type='value', value='#D3D3D3'), source_notes_multiline=OptionsInfo(scss=False, category='source_notes', type='boolean', value=True), source_notes_sep=OptionsInfo(scss=False, category='source_notes', type='value', value=' '), row_striping_background_color=OptionsInfo(scss=True, category='row', type='value', value='rgba(128,128,128,0.05)'), row_striping_include_stub=OptionsInfo(scss=False, category='row', type='boolean', value=False), row_striping_include_table_body=OptionsInfo(scss=False, category='row', type='boolean', value=False), container_width=OptionsInfo(scss=False, category='container', type='px', value='auto'), container_height=OptionsInfo(scss=False, category='container', type='px', value='auto'), container_padding_x=OptionsInfo(scss=False, category='container', type='px', value='0px'), container_padding_y=OptionsInfo(scss=False, category='container', type='px', value='10px'), container_overflow_x=OptionsInfo(scss=False, category='container', type='overflow', value='auto'), container_overflow_y=OptionsInfo(scss=False, category='container', type='overflow', value='auto'), quarto_disable_processing=OptionsInfo(scss=False, category='quarto', type='logical', value=False), quarto_use_bootstrap=OptionsInfo(scss=False, category='quarto', type='logical', value=False)), _has_built=False)\n\n\nThe options for removing the data area and the data line (though the corresponding show_* arguments of nanoplot_options()) make the finalized nanoplots look somewhat like scatter plots.", "crumbs": [ "Get Started", "Format", @@ -750,7 +750,7 @@ "href": "reference/GT.as_raw_html.html#examples", "title": "GT.as_raw_html", "section": "Examples:", - "text": "Examples:\nLet’s use a subset of the gtcars dataset to create a new table.\n\nfrom great_tables import GT, md, style, loc\nfrom great_tables.data import gtcars\nimport polars as pl\n\ngtcars_mini = (\n pl.from_pandas(gtcars)\n .select([\"mfr\", \"model\", \"msrp\"])\n .head(5)\n)\n\ngt_tbl = (\n GT(gtcars_mini)\n .tab_header(\n title=md(\"Data listing from **gtcars**\"),\n subtitle=md(\"gtcars is an R dataset\")\n )\n .tab_style(\n style=style.fill(color=\"LightCyan\"),\n locations=loc.body(columns=\"mfr\")\n )\n .fmt_currency(columns=\"msrp\")\n .tab_options(\n heading_background_color=\"Azure\",\n table_body_hlines_color=\"Lavender\",\n table_body_hlines_width=\"2px\"\n )\n .opt_horizontal_padding(scale=2)\n)\n\ngt_tbl\n\n\n\n\n\n\n \n Data listing from gtcars\n \n \n gtcars is an R dataset\n \n\n mfr\n model\n msrp\n\n\n\n \n Ford\n GT\n $447,000.00\n \n \n Ferrari\n 458 Speciale\n $291,744.00\n \n \n Ferrari\n 458 Spider\n $263,553.00\n \n \n Ferrari\n 458 Italia\n $233,509.00\n \n \n Ferrari\n 488 GTB\n $245,400.00\n \n\n\n\n\n\n\n \n\n\nNow we can return the table as an HTML string using the as_raw_html() method.\n\ngt_tbl.as_raw_html()\n\n'<div id=\"tdmmfufxat\" style=\"padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;\">\\n<style>\\n#tdmmfufxat table {\\n font-family: -apple-system, BlinkMacSystemFont, \\'Segoe UI\\', Roboto, Oxygen, Ubuntu, Cantarell, \\'Helvetica Neue\\', \\'Fira Sans\\', \\'Droid Sans\\', Arial, sans-serif;\\n -webkit-font-smoothing: antialiased;\\n -moz-osx-font-smoothing: grayscale;\\n }\\n\\n#tdmmfufxat thead, tbody, tfoot, tr, td, th { border-style: none; }\\n tr { background-color: transparent; }\\n#tdmmfufxat p { margin: 0; padding: 0; }\\n #tdmmfufxat .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }\\n #tdmmfufxat .gt_caption { padding-top: 4px; padding-bottom: 4px; }\\n #tdmmfufxat .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }\\n #tdmmfufxat .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-top-color: #FFFFFF; border-top-width: 0; }\\n #tdmmfufxat .gt_heading { background-color: Azure; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\\n #tdmmfufxat .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\\n #tdmmfufxat .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\\n #tdmmfufxat .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }\\n #tdmmfufxat .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }\\n #tdmmfufxat .gt_column_spanner_outer:first-child { padding-left: 0; }\\n #tdmmfufxat .gt_column_spanner_outer:last-child { padding-right: 0; }\\n #tdmmfufxat .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }\\n #tdmmfufxat .gt_spanner_row { border-bottom-style: hidden; }\\n #tdmmfufxat .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }\\n #tdmmfufxat .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }\\n #tdmmfufxat .gt_from_md> :first-child { margin-top: 0; }\\n #tdmmfufxat .gt_from_md> :last-child { margin-bottom: 0; }\\n #tdmmfufxat .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; margin: 10px; border-top-style: solid; border-top-width: 2px; border-top-color: Lavender; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }\\n #tdmmfufxat .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; }\\n #tdmmfufxat .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; vertical-align: top; }\\n #tdmmfufxat .gt_row_group_first td { border-top-width: 2px; }\\n #tdmmfufxat .gt_row_group_first th { border-top-width: 2px; }\\n #tdmmfufxat .gt_striped { background-color: rgba(128,128,128,0.05); }\\n #tdmmfufxat .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\\n #tdmmfufxat .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }\\n #tdmmfufxat .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }\\n #tdmmfufxat .gt_left { text-align: left; }\\n #tdmmfufxat .gt_center { text-align: center; }\\n #tdmmfufxat .gt_right { text-align: right; font-variant-numeric: tabular-nums; }\\n #tdmmfufxat .gt_font_normal { font-weight: normal; }\\n #tdmmfufxat .gt_font_bold { font-weight: bold; }\\n #tdmmfufxat .gt_font_italic { font-style: italic; }\\n #tdmmfufxat .gt_super { font-size: 65%; }\\n #tdmmfufxat .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }\\n #tdmmfufxat .gt_asterisk { font-size: 100%; vertical-align: 0; }\\n \\n</style>\\n<table class=\"gt_table\" data-quarto-disable-processing=\"false\" data-quarto-bootstrap=\"false\">\\n<thead>\\n\\n <tr class=\"gt_heading\">\\n <td colspan=\"3\" class=\"gt_heading gt_title gt_font_normal\">Data listing from <strong>gtcars</strong></td>\\n </tr>\\n <tr class=\"gt_heading\">\\n <td colspan=\"3\" class=\"gt_heading gt_subtitle gt_font_normal gt_bottom_border\">gtcars is an R dataset</td>\\n </tr>\\n<tr class=\"gt_col_headings\">\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"mfr\">mfr</th>\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"model\">model</th>\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_right\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"msrp\">msrp</th>\\n</tr>\\n</thead>\\n<tbody class=\"gt_table_body\">\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ford</td>\\n <td class=\"gt_row gt_left\">GT</td>\\n <td class=\"gt_row gt_right\">$447,000.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">458 Speciale</td>\\n <td class=\"gt_row gt_right\">$291,744.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">458 Spider</td>\\n <td class=\"gt_row gt_right\">$263,553.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">458 Italia</td>\\n <td class=\"gt_row gt_right\">$233,509.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">488 GTB</td>\\n <td class=\"gt_row gt_right\">$245,400.00</td>\\n </tr>\\n</tbody>\\n\\n\\n</table>\\n\\n</div>\\n '\n\n\nThe HTML string contains the HTML for the table. It has only the table so it’s not a complete HTML document but rather an HTML fragment. While this useful for embedding a table in an existing HTML document, you could also use the make_page=True argument to get a complete HTML page with the table contained within.\n\ngt_tbl.as_raw_html(make_page=True)\n\n'<!DOCTYPE html>\\n<html lang=\"en\">\\n<head>\\n<meta charset=\"utf-8\"/>\\n</head>\\n<body>\\n<div id=\"ruypjqrsqh\" style=\"padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;\">\\n<style>\\n#ruypjqrsqh table {\\n font-family: -apple-system, BlinkMacSystemFont, \\'Segoe UI\\', Roboto, Oxygen, Ubuntu, Cantarell, \\'Helvetica Neue\\', \\'Fira Sans\\', \\'Droid Sans\\', Arial, sans-serif;\\n -webkit-font-smoothing: antialiased;\\n -moz-osx-font-smoothing: grayscale;\\n }\\n\\n#ruypjqrsqh thead, tbody, tfoot, tr, td, th { border-style: none; }\\n tr { background-color: transparent; }\\n#ruypjqrsqh p { margin: 0; padding: 0; }\\n #ruypjqrsqh .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }\\n #ruypjqrsqh .gt_caption { padding-top: 4px; padding-bottom: 4px; }\\n #ruypjqrsqh .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }\\n #ruypjqrsqh .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-top-color: #FFFFFF; border-top-width: 0; }\\n #ruypjqrsqh .gt_heading { background-color: Azure; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\\n #ruypjqrsqh .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\\n #ruypjqrsqh .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\\n #ruypjqrsqh .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }\\n #ruypjqrsqh .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }\\n #ruypjqrsqh .gt_column_spanner_outer:first-child { padding-left: 0; }\\n #ruypjqrsqh .gt_column_spanner_outer:last-child { padding-right: 0; }\\n #ruypjqrsqh .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }\\n #ruypjqrsqh .gt_spanner_row { border-bottom-style: hidden; }\\n #ruypjqrsqh .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }\\n #ruypjqrsqh .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }\\n #ruypjqrsqh .gt_from_md> :first-child { margin-top: 0; }\\n #ruypjqrsqh .gt_from_md> :last-child { margin-bottom: 0; }\\n #ruypjqrsqh .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; margin: 10px; border-top-style: solid; border-top-width: 2px; border-top-color: Lavender; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }\\n #ruypjqrsqh .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; }\\n #ruypjqrsqh .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; vertical-align: top; }\\n #ruypjqrsqh .gt_row_group_first td { border-top-width: 2px; }\\n #ruypjqrsqh .gt_row_group_first th { border-top-width: 2px; }\\n #ruypjqrsqh .gt_striped { background-color: rgba(128,128,128,0.05); }\\n #ruypjqrsqh .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\\n #ruypjqrsqh .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }\\n #ruypjqrsqh .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }\\n #ruypjqrsqh .gt_left { text-align: left; }\\n #ruypjqrsqh .gt_center { text-align: center; }\\n #ruypjqrsqh .gt_right { text-align: right; font-variant-numeric: tabular-nums; }\\n #ruypjqrsqh .gt_font_normal { font-weight: normal; }\\n #ruypjqrsqh .gt_font_bold { font-weight: bold; }\\n #ruypjqrsqh .gt_font_italic { font-style: italic; }\\n #ruypjqrsqh .gt_super { font-size: 65%; }\\n #ruypjqrsqh .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }\\n #ruypjqrsqh .gt_asterisk { font-size: 100%; vertical-align: 0; }\\n \\n</style>\\n<table class=\"gt_table\" data-quarto-disable-processing=\"false\" data-quarto-bootstrap=\"false\">\\n<thead>\\n\\n <tr class=\"gt_heading\">\\n <td colspan=\"3\" class=\"gt_heading gt_title gt_font_normal\">Data listing from <strong>gtcars</strong></td>\\n </tr>\\n <tr class=\"gt_heading\">\\n <td colspan=\"3\" class=\"gt_heading gt_subtitle gt_font_normal gt_bottom_border\">gtcars is an R dataset</td>\\n </tr>\\n<tr class=\"gt_col_headings\">\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"mfr\">mfr</th>\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"model\">model</th>\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_right\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"msrp\">msrp</th>\\n</tr>\\n</thead>\\n<tbody class=\"gt_table_body\">\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ford</td>\\n <td class=\"gt_row gt_left\">GT</td>\\n <td class=\"gt_row gt_right\">$447,000.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">458 Speciale</td>\\n <td class=\"gt_row gt_right\">$291,744.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">458 Spider</td>\\n <td class=\"gt_row gt_right\">$263,553.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">458 Italia</td>\\n <td class=\"gt_row gt_right\">$233,509.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">488 GTB</td>\\n <td class=\"gt_row gt_right\">$245,400.00</td>\\n </tr>\\n</tbody>\\n\\n\\n</table>\\n\\n</div>\\n \\n</body>\\n</html>\\n '\n\n\nShould you want to include all of the CSS styles as inline styles, you can use inline_css=True to get an HTML string with all CSS inlined into the HTML tags.\n\ngt_tbl.as_raw_html(inline_css=True)\n\n'<div id=\"qgokjidufa\" style=\"padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;\">\\n\\n<table class=\"gt_table\" data-quarto-bootstrap=\"false\" data-quarto-disable-processing=\"false\" style=\"font-family: -apple-system, BlinkMacSystemFont, \\'Segoe UI\\', Roboto, Oxygen, Ubuntu, Cantarell, \\'Helvetica Neue\\', \\'Fira Sans\\', \\'Droid Sans\\', Arial, sans-serif;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;display: table;border-collapse: collapse;line-height: normal;margin-left: auto;margin-right: auto;color: #333333;font-size: 16px;font-weight: normal;font-style: normal;background-color: #FFFFFF;width: auto;border-top-style: solid;border-top-width: 2px;border-top-color: #A8A8A8;border-right-style: none;border-right-width: 2px;border-right-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;border-bottom-color: #A8A8A8;border-left-style: none;border-left-width: 2px;border-left-color: #D3D3D3;\">\\n<thead style=\"border-style: none;\">\\n\\n <tr class=\"gt_heading\" style=\"border-style: none;background-color: Azure;text-align: center;border-bottom-color: #FFFFFF;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;\">\\n <td class=\"gt_heading gt_title gt_font_normal\" colspan=\"3\" style=\"border-style: none;color: #333333;font-size: 125%;font-weight: normal;padding-top: 4px;padding-bottom: 4px;padding-left: 10px;padding-right: 10px;border-bottom-color: #FFFFFF;border-bottom-width: 0;background-color: Azure;text-align: center;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;\">Data listing from <strong>gtcars</strong></td>\\n </tr>\\n <tr class=\"gt_heading\" style=\"border-style: none;background-color: Azure;text-align: center;border-bottom-color: #FFFFFF;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;\">\\n <td class=\"gt_heading gt_subtitle gt_font_normal gt_bottom_border\" colspan=\"3\" style=\"border-style: none;color: #333333;font-size: 85%;font-weight: normal;padding-top: 3px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;border-top-color: #FFFFFF;border-top-width: 0;background-color: Azure;text-align: center;border-bottom-color: #D3D3D3;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;\">gtcars is an R dataset</td>\\n </tr>\\n<tr class=\"gt_col_headings\" style=\"border-style: none;background-color: transparent;border-top-style: solid;border-top-width: 2px;border-top-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;border-bottom-color: #D3D3D3;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;\">\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" id=\"mfr\" rowspan=\"1\" colspan=\"1\" scope=\"col\" style=\"border-style: none;color: #333333;background-color: #FFFFFF;font-size: 100%;font-weight: normal;text-transform: inherit;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: bottom;padding-top: 5px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;overflow-x: hidden;text-align: left;\">mfr</th>\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" id=\"model\" rowspan=\"1\" colspan=\"1\" scope=\"col\" style=\"border-style: none;color: #333333;background-color: #FFFFFF;font-size: 100%;font-weight: normal;text-transform: inherit;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: bottom;padding-top: 5px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;overflow-x: hidden;text-align: left;\">model</th>\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_right\" id=\"msrp\" rowspan=\"1\" colspan=\"1\" scope=\"col\" style=\"border-style: none;color: #333333;background-color: #FFFFFF;font-size: 100%;font-weight: normal;text-transform: inherit;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: bottom;padding-top: 5px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;\">msrp</th>\\n</tr>\\n</thead>\\n<tbody class=\"gt_table_body\" style=\"border-style: none;border-top-style: solid;border-top-width: 2px;border-top-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;border-bottom-color: #D3D3D3;\">\\n <tr style=\"border-style: none;background-color: transparent;\">\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan\">Ford</td>\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;\">GT</td>\\n <td class=\"gt_row gt_right\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;\">$447,000.00</td>\\n </tr>\\n <tr style=\"border-style: none;background-color: transparent;\">\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan\">Ferrari</td>\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;\">458 Speciale</td>\\n <td class=\"gt_row gt_right\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;\">$291,744.00</td>\\n </tr>\\n <tr style=\"border-style: none;background-color: transparent;\">\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan\">Ferrari</td>\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;\">458 Spider</td>\\n <td class=\"gt_row gt_right\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;\">$263,553.00</td>\\n </tr>\\n <tr style=\"border-style: none;background-color: transparent;\">\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan\">Ferrari</td>\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;\">458 Italia</td>\\n <td class=\"gt_row gt_right\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;\">$233,509.00</td>\\n </tr>\\n <tr style=\"border-style: none;background-color: transparent;\">\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan\">Ferrari</td>\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;\">488 GTB</td>\\n <td class=\"gt_row gt_right\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;\">$245,400.00</td>\\n </tr>\\n</tbody>\\n\\n\\n</table>\\n\\n</div>'" + "text": "Examples:\nLet’s use a subset of the gtcars dataset to create a new table.\n\nfrom great_tables import GT, md, style, loc\nfrom great_tables.data import gtcars\nimport polars as pl\n\ngtcars_mini = (\n pl.from_pandas(gtcars)\n .select([\"mfr\", \"model\", \"msrp\"])\n .head(5)\n)\n\ngt_tbl = (\n GT(gtcars_mini)\n .tab_header(\n title=md(\"Data listing from **gtcars**\"),\n subtitle=md(\"gtcars is an R dataset\")\n )\n .tab_style(\n style=style.fill(color=\"LightCyan\"),\n locations=loc.body(columns=\"mfr\")\n )\n .fmt_currency(columns=\"msrp\")\n .tab_options(\n heading_background_color=\"Azure\",\n table_body_hlines_color=\"Lavender\",\n table_body_hlines_width=\"2px\"\n )\n .opt_horizontal_padding(scale=2)\n)\n\ngt_tbl\n\n\n\n\n\n\n \n Data listing from gtcars\n \n \n gtcars is an R dataset\n \n\n mfr\n model\n msrp\n\n\n\n \n Ford\n GT\n $447,000.00\n \n \n Ferrari\n 458 Speciale\n $291,744.00\n \n \n Ferrari\n 458 Spider\n $263,553.00\n \n \n Ferrari\n 458 Italia\n $233,509.00\n \n \n Ferrari\n 488 GTB\n $245,400.00\n \n\n\n\n\n\n\n \n\n\nNow we can return the table as an HTML string using the as_raw_html() method.\n\ngt_tbl.as_raw_html()\n\n'<div id=\"itnnuhefgh\" style=\"padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;\">\\n<style>\\n#itnnuhefgh table {\\n font-family: -apple-system, BlinkMacSystemFont, \\'Segoe UI\\', Roboto, Oxygen, Ubuntu, Cantarell, \\'Helvetica Neue\\', \\'Fira Sans\\', \\'Droid Sans\\', Arial, sans-serif;\\n -webkit-font-smoothing: antialiased;\\n -moz-osx-font-smoothing: grayscale;\\n }\\n\\n#itnnuhefgh thead, tbody, tfoot, tr, td, th { border-style: none; }\\n tr { background-color: transparent; }\\n#itnnuhefgh p { margin: 0; padding: 0; }\\n #itnnuhefgh .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }\\n #itnnuhefgh .gt_caption { padding-top: 4px; padding-bottom: 4px; }\\n #itnnuhefgh .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }\\n #itnnuhefgh .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-top-color: #FFFFFF; border-top-width: 0; }\\n #itnnuhefgh .gt_heading { background-color: Azure; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\\n #itnnuhefgh .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\\n #itnnuhefgh .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\\n #itnnuhefgh .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }\\n #itnnuhefgh .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }\\n #itnnuhefgh .gt_column_spanner_outer:first-child { padding-left: 0; }\\n #itnnuhefgh .gt_column_spanner_outer:last-child { padding-right: 0; }\\n #itnnuhefgh .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }\\n #itnnuhefgh .gt_spanner_row { border-bottom-style: hidden; }\\n #itnnuhefgh .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }\\n #itnnuhefgh .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }\\n #itnnuhefgh .gt_from_md> :first-child { margin-top: 0; }\\n #itnnuhefgh .gt_from_md> :last-child { margin-bottom: 0; }\\n #itnnuhefgh .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; margin: 10px; border-top-style: solid; border-top-width: 2px; border-top-color: Lavender; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }\\n #itnnuhefgh .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; }\\n #itnnuhefgh .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; vertical-align: top; }\\n #itnnuhefgh .gt_row_group_first td { border-top-width: 2px; }\\n #itnnuhefgh .gt_row_group_first th { border-top-width: 2px; }\\n #itnnuhefgh .gt_striped { background-color: rgba(128,128,128,0.05); }\\n #itnnuhefgh .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\\n #itnnuhefgh .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }\\n #itnnuhefgh .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }\\n #itnnuhefgh .gt_left { text-align: left; }\\n #itnnuhefgh .gt_center { text-align: center; }\\n #itnnuhefgh .gt_right { text-align: right; font-variant-numeric: tabular-nums; }\\n #itnnuhefgh .gt_font_normal { font-weight: normal; }\\n #itnnuhefgh .gt_font_bold { font-weight: bold; }\\n #itnnuhefgh .gt_font_italic { font-style: italic; }\\n #itnnuhefgh .gt_super { font-size: 65%; }\\n #itnnuhefgh .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }\\n #itnnuhefgh .gt_asterisk { font-size: 100%; vertical-align: 0; }\\n \\n</style>\\n<table class=\"gt_table\" data-quarto-disable-processing=\"false\" data-quarto-bootstrap=\"false\">\\n<thead>\\n\\n <tr class=\"gt_heading\">\\n <td colspan=\"3\" class=\"gt_heading gt_title gt_font_normal\">Data listing from <strong>gtcars</strong></td>\\n </tr>\\n <tr class=\"gt_heading\">\\n <td colspan=\"3\" class=\"gt_heading gt_subtitle gt_font_normal gt_bottom_border\">gtcars is an R dataset</td>\\n </tr>\\n<tr class=\"gt_col_headings\">\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"mfr\">mfr</th>\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"model\">model</th>\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_right\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"msrp\">msrp</th>\\n</tr>\\n</thead>\\n<tbody class=\"gt_table_body\">\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ford</td>\\n <td class=\"gt_row gt_left\">GT</td>\\n <td class=\"gt_row gt_right\">$447,000.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">458 Speciale</td>\\n <td class=\"gt_row gt_right\">$291,744.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">458 Spider</td>\\n <td class=\"gt_row gt_right\">$263,553.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">458 Italia</td>\\n <td class=\"gt_row gt_right\">$233,509.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">488 GTB</td>\\n <td class=\"gt_row gt_right\">$245,400.00</td>\\n </tr>\\n</tbody>\\n\\n\\n</table>\\n\\n</div>\\n '\n\n\nThe HTML string contains the HTML for the table. It has only the table so it’s not a complete HTML document but rather an HTML fragment. While this useful for embedding a table in an existing HTML document, you could also use the make_page=True argument to get a complete HTML page with the table contained within.\n\ngt_tbl.as_raw_html(make_page=True)\n\n'<!DOCTYPE html>\\n<html lang=\"en\">\\n<head>\\n<meta charset=\"utf-8\"/>\\n</head>\\n<body>\\n<div id=\"hhmpnixtaz\" style=\"padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;\">\\n<style>\\n#hhmpnixtaz table {\\n font-family: -apple-system, BlinkMacSystemFont, \\'Segoe UI\\', Roboto, Oxygen, Ubuntu, Cantarell, \\'Helvetica Neue\\', \\'Fira Sans\\', \\'Droid Sans\\', Arial, sans-serif;\\n -webkit-font-smoothing: antialiased;\\n -moz-osx-font-smoothing: grayscale;\\n }\\n\\n#hhmpnixtaz thead, tbody, tfoot, tr, td, th { border-style: none; }\\n tr { background-color: transparent; }\\n#hhmpnixtaz p { margin: 0; padding: 0; }\\n #hhmpnixtaz .gt_table { display: table; border-collapse: collapse; line-height: normal; margin-left: auto; margin-right: auto; color: #333333; font-size: 16px; font-weight: normal; font-style: normal; background-color: #FFFFFF; width: auto; border-top-style: solid; border-top-width: 2px; border-top-color: #A8A8A8; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #A8A8A8; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; }\\n #hhmpnixtaz .gt_caption { padding-top: 4px; padding-bottom: 4px; }\\n #hhmpnixtaz .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }\\n #hhmpnixtaz .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; border-top-color: #FFFFFF; border-top-width: 0; }\\n #hhmpnixtaz .gt_heading { background-color: Azure; text-align: center; border-bottom-color: #FFFFFF; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\\n #hhmpnixtaz .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\\n #hhmpnixtaz .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }\\n #hhmpnixtaz .gt_col_heading { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }\\n #hhmpnixtaz .gt_column_spanner_outer { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }\\n #hhmpnixtaz .gt_column_spanner_outer:first-child { padding-left: 0; }\\n #hhmpnixtaz .gt_column_spanner_outer:last-child { padding-right: 0; }\\n #hhmpnixtaz .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }\\n #hhmpnixtaz .gt_spanner_row { border-bottom-style: hidden; }\\n #hhmpnixtaz .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; text-align: left; }\\n #hhmpnixtaz .gt_empty_group_heading { padding: 0.5px; color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; vertical-align: middle; }\\n #hhmpnixtaz .gt_from_md> :first-child { margin-top: 0; }\\n #hhmpnixtaz .gt_from_md> :last-child { margin-bottom: 0; }\\n #hhmpnixtaz .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; margin: 10px; border-top-style: solid; border-top-width: 2px; border-top-color: Lavender; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; vertical-align: middle; overflow-x: hidden; }\\n #hhmpnixtaz .gt_stub { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; }\\n #hhmpnixtaz .gt_stub_row_group { color: #333333; background-color: #FFFFFF; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: solid; border-right-width: 2px; border-right-color: #D3D3D3; padding-left: 10px; padding-right: 10px; vertical-align: top; }\\n #hhmpnixtaz .gt_row_group_first td { border-top-width: 2px; }\\n #hhmpnixtaz .gt_row_group_first th { border-top-width: 2px; }\\n #hhmpnixtaz .gt_striped { background-color: rgba(128,128,128,0.05); }\\n #hhmpnixtaz .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }\\n #hhmpnixtaz .gt_sourcenotes { color: #333333; background-color: #FFFFFF; border-bottom-style: none; border-bottom-width: 2px; border-bottom-color: #D3D3D3; border-left-style: none; border-left-width: 2px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 2px; border-right-color: #D3D3D3; }\\n #hhmpnixtaz .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 10px; padding-right: 10px; text-align: left; }\\n #hhmpnixtaz .gt_left { text-align: left; }\\n #hhmpnixtaz .gt_center { text-align: center; }\\n #hhmpnixtaz .gt_right { text-align: right; font-variant-numeric: tabular-nums; }\\n #hhmpnixtaz .gt_font_normal { font-weight: normal; }\\n #hhmpnixtaz .gt_font_bold { font-weight: bold; }\\n #hhmpnixtaz .gt_font_italic { font-style: italic; }\\n #hhmpnixtaz .gt_super { font-size: 65%; }\\n #hhmpnixtaz .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }\\n #hhmpnixtaz .gt_asterisk { font-size: 100%; vertical-align: 0; }\\n \\n</style>\\n<table class=\"gt_table\" data-quarto-disable-processing=\"false\" data-quarto-bootstrap=\"false\">\\n<thead>\\n\\n <tr class=\"gt_heading\">\\n <td colspan=\"3\" class=\"gt_heading gt_title gt_font_normal\">Data listing from <strong>gtcars</strong></td>\\n </tr>\\n <tr class=\"gt_heading\">\\n <td colspan=\"3\" class=\"gt_heading gt_subtitle gt_font_normal gt_bottom_border\">gtcars is an R dataset</td>\\n </tr>\\n<tr class=\"gt_col_headings\">\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"mfr\">mfr</th>\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"model\">model</th>\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_right\" rowspan=\"1\" colspan=\"1\" scope=\"col\" id=\"msrp\">msrp</th>\\n</tr>\\n</thead>\\n<tbody class=\"gt_table_body\">\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ford</td>\\n <td class=\"gt_row gt_left\">GT</td>\\n <td class=\"gt_row gt_right\">$447,000.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">458 Speciale</td>\\n <td class=\"gt_row gt_right\">$291,744.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">458 Spider</td>\\n <td class=\"gt_row gt_right\">$263,553.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">458 Italia</td>\\n <td class=\"gt_row gt_right\">$233,509.00</td>\\n </tr>\\n <tr>\\n <td style=\"background-color: LightCyan;\" class=\"gt_row gt_left\">Ferrari</td>\\n <td class=\"gt_row gt_left\">488 GTB</td>\\n <td class=\"gt_row gt_right\">$245,400.00</td>\\n </tr>\\n</tbody>\\n\\n\\n</table>\\n\\n</div>\\n \\n</body>\\n</html>\\n '\n\n\nShould you want to include all of the CSS styles as inline styles, you can use inline_css=True to get an HTML string with all CSS inlined into the HTML tags.\n\ngt_tbl.as_raw_html(inline_css=True)\n\n'<div id=\"povwlrbjit\" style=\"padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;\">\\n\\n<table class=\"gt_table\" data-quarto-bootstrap=\"false\" data-quarto-disable-processing=\"false\" style=\"font-family: -apple-system, BlinkMacSystemFont, \\'Segoe UI\\', Roboto, Oxygen, Ubuntu, Cantarell, \\'Helvetica Neue\\', \\'Fira Sans\\', \\'Droid Sans\\', Arial, sans-serif;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;display: table;border-collapse: collapse;line-height: normal;margin-left: auto;margin-right: auto;color: #333333;font-size: 16px;font-weight: normal;font-style: normal;background-color: #FFFFFF;width: auto;border-top-style: solid;border-top-width: 2px;border-top-color: #A8A8A8;border-right-style: none;border-right-width: 2px;border-right-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;border-bottom-color: #A8A8A8;border-left-style: none;border-left-width: 2px;border-left-color: #D3D3D3;\">\\n<thead style=\"border-style: none;\">\\n\\n <tr class=\"gt_heading\" style=\"border-style: none;background-color: Azure;text-align: center;border-bottom-color: #FFFFFF;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;\">\\n <td class=\"gt_heading gt_title gt_font_normal\" colspan=\"3\" style=\"border-style: none;color: #333333;font-size: 125%;font-weight: normal;padding-top: 4px;padding-bottom: 4px;padding-left: 10px;padding-right: 10px;border-bottom-color: #FFFFFF;border-bottom-width: 0;background-color: Azure;text-align: center;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;\">Data listing from <strong>gtcars</strong></td>\\n </tr>\\n <tr class=\"gt_heading\" style=\"border-style: none;background-color: Azure;text-align: center;border-bottom-color: #FFFFFF;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;\">\\n <td class=\"gt_heading gt_subtitle gt_font_normal gt_bottom_border\" colspan=\"3\" style=\"border-style: none;color: #333333;font-size: 85%;font-weight: normal;padding-top: 3px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;border-top-color: #FFFFFF;border-top-width: 0;background-color: Azure;text-align: center;border-bottom-color: #D3D3D3;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;\">gtcars is an R dataset</td>\\n </tr>\\n<tr class=\"gt_col_headings\" style=\"border-style: none;background-color: transparent;border-top-style: solid;border-top-width: 2px;border-top-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;border-bottom-color: #D3D3D3;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;\">\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" id=\"mfr\" rowspan=\"1\" colspan=\"1\" scope=\"col\" style=\"border-style: none;color: #333333;background-color: #FFFFFF;font-size: 100%;font-weight: normal;text-transform: inherit;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: bottom;padding-top: 5px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;overflow-x: hidden;text-align: left;\">mfr</th>\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_left\" id=\"model\" rowspan=\"1\" colspan=\"1\" scope=\"col\" style=\"border-style: none;color: #333333;background-color: #FFFFFF;font-size: 100%;font-weight: normal;text-transform: inherit;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: bottom;padding-top: 5px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;overflow-x: hidden;text-align: left;\">model</th>\\n <th class=\"gt_col_heading gt_columns_bottom_border gt_right\" id=\"msrp\" rowspan=\"1\" colspan=\"1\" scope=\"col\" style=\"border-style: none;color: #333333;background-color: #FFFFFF;font-size: 100%;font-weight: normal;text-transform: inherit;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: bottom;padding-top: 5px;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;\">msrp</th>\\n</tr>\\n</thead>\\n<tbody class=\"gt_table_body\" style=\"border-style: none;border-top-style: solid;border-top-width: 2px;border-top-color: #D3D3D3;border-bottom-style: solid;border-bottom-width: 2px;border-bottom-color: #D3D3D3;\">\\n <tr style=\"border-style: none;background-color: transparent;\">\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan\">Ford</td>\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;\">GT</td>\\n <td class=\"gt_row gt_right\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;\">$447,000.00</td>\\n </tr>\\n <tr style=\"border-style: none;background-color: transparent;\">\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan\">Ferrari</td>\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;\">458 Speciale</td>\\n <td class=\"gt_row gt_right\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;\">$291,744.00</td>\\n </tr>\\n <tr style=\"border-style: none;background-color: transparent;\">\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan\">Ferrari</td>\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;\">458 Spider</td>\\n <td class=\"gt_row gt_right\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;\">$263,553.00</td>\\n </tr>\\n <tr style=\"border-style: none;background-color: transparent;\">\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan\">Ferrari</td>\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;\">458 Italia</td>\\n <td class=\"gt_row gt_right\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;\">$233,509.00</td>\\n </tr>\\n <tr style=\"border-style: none;background-color: transparent;\">\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;background-color: LightCyan\">Ferrari</td>\\n <td class=\"gt_row gt_left\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: left;\">488 GTB</td>\\n <td class=\"gt_row gt_right\" style=\"border-style: none;padding-top: 8px;padding-bottom: 8px;padding-left: 10px;padding-right: 10px;margin: 10px;border-top-style: solid;border-top-width: 2px;border-top-color: Lavender;border-left-style: none;border-left-width: 1px;border-left-color: #D3D3D3;border-right-style: none;border-right-width: 1px;border-right-color: #D3D3D3;vertical-align: middle;overflow-x: hidden;text-align: right;font-variant-numeric: tabular-nums;\">$245,400.00</td>\\n </tr>\\n</tbody>\\n\\n\\n</table>\\n\\n</div>'" }, { "objectID": "reference/vals.fmt_bytes.html", @@ -3972,7 +3972,7 @@ "href": "blog/open-transit-tools/index.html#why-focus-on-open-source-in-public-transit", "title": "Contributing to Public Transit Data Analysis and Tooling", "section": "Why focus on open source in public transit?", - "text": "Why focus on open source in public transit?\nPeople doing analytics in public transit are active in developing open data standards (like GTFS, GTFS-RT, and TIDES). These open data sources are complex—they cover schedules that change from week to week, busses moving in realtime, and passenger events. As people like me work more and more on open source tools, we start to lose touch with data analysis in realistic, complex settings. Working on open source transit data is an opportunity for me to ensure my open source tooling work helps people solve real, complex problems.\nAn inspiration for this angle is the book R for Data Science, which uses realistic datasets—like NYC flights data—to teach data analysis using an ecosystem of packages called the Tidyverse. The Tidyverse packages have dozens of example datasets, and I think this focus on working through examples is part of what made their design so great.\nA few years ago, I worked with the Cal-ITP project to build out a warehouse for their GTFS schedule and realtime data. This left a profound impression on me: transit data is perfect for educating on data analyses in R and Python, as well as analytics engineering with tools like dbt or sqlmesh. Many analysts in public transit are querying warehouses, which opens up interesting use-cases with tools like dbplyr (in R) and ibis (in Python).\n(I’m also inspired by tools like tidytransit, and other communities like pharmaverse.org.)\nHere are some relevant talks:\n\nTidy Transit: Real Life Data Modeling for Public Transportation (Hunter Owens, Cal-ITP)\nThe Accidental Analytics Engineer (Michael Chow)" + "text": "Why focus on open source in public transit?\nPeople doing analytics in public transit are active in developing open data standards (like GTFS, GTFS-RT, and TIDES). These open data sources are complex—they cover schedules that change from week to week, buses moving in realtime, and passenger events. As people like me work more and more on open source tools, we start to lose touch with data analysis in realistic, complex settings. Working on open source transit data is an opportunity for me to ensure my open source tooling work helps people solve real, complex problems.\nAn inspiration for this angle is the book R for Data Science, which uses realistic datasets—like NYC flights data—to teach data analysis using an ecosystem of packages called the Tidyverse. The Tidyverse packages have dozens of example datasets, and I think this focus on working through examples is part of what made their design so great.\nA few years ago, I worked with the Cal-ITP project to build out a warehouse for their GTFS schedule and realtime data. This left a profound impression on me: transit data is perfect for educating on data analyses in R and Python, as well as analytics engineering with tools like dbt or sqlmesh. Many analysts in public transit are querying warehouses, which opens up interesting use-cases with tools like dbplyr (in R) and ibis (in Python).\n(I’m also inspired by tools like tidytransit, and other communities like pharmaverse.org.)\nHere are some relevant talks:\n\nTidy Transit: Real Life Data Modeling for Public Transportation (Hunter Owens, Cal-ITP)\nThe Accidental Analytics Engineer (Michael Chow)" }, { "objectID": "blog/open-transit-tools/index.html#why-is-this-on-the-great-tables-blog", @@ -3986,7 +3986,7 @@ "href": "blog/open-transit-tools/index.html#what-are-you-hoping-to-contribute", "title": "Contributing to Public Transit Data Analysis and Tooling", "section": "What are you hoping to contribute?", - "text": "What are you hoping to contribute?\nI’m hoping to focus on two things:\n\nWorkshops to support R and Python analyst teams (and help me appreciate their needs).\nCollaboration on creating open source tools and guides for analyzing transit data.\n\n\nWorkshops\nBeyond my obvious potential involvement as a table fanatic, I’m really interested in making the daily lives of R and Python users at public transit agencies easier.\n\nWorkshops on R. Think Tidyverse, Shiny, Quarto, querying warehouses.\nWorkshops on Python. Let’s say Polars, Quarto, publishing notebooks, Great Tables, dashboards.\nAnalytics engineering. How to get analysts to use your data models 😓.\n\nI’m open to whatever topics seem most useful, even if they aren’t in the list above.\n\n\n\n\n\n\nScheduling a workshop\n\n\n\nIf you’re a public transit agency, reach out on linkedin or bluesky, and I will send my calendly for scheduling.\n\n\n\n\nCollaboration\nI’m interested in understanding major challenges analytics teams working on public transit face, and the kind of strategic and tooling support they’d most benefit from. If you’re working on analytics in public transit, I would love to hear about what you’re working on, and the tools you use most.\nOne topic I’ve discussed with a few agencies is ghost busses, which is when a bus is scheduled but never shows up. This is an interesting analysis because it combines GTFS schedule data with GTFS-RT realtime bus data.\nAnother is passenger events (e.g. people tapping on or off a bus). This data is challenging because different vendors data record and deliver this data in different ways. This can make it hard for analysts across agencies to discuss analyses—every analysis is different in its own way." + "text": "What are you hoping to contribute?\nI’m hoping to focus on two things:\n\nWorkshops to support R and Python analyst teams (and help me appreciate their needs).\nCollaboration on creating open source tools and guides for analyzing transit data.\n\n\nWorkshops\nBeyond my obvious potential involvement as a table fanatic, I’m really interested in making the daily lives of R and Python users at public transit agencies easier.\n\nWorkshops on R. Think Tidyverse, Shiny, Quarto, querying warehouses.\nWorkshops on Python. Let’s say Polars, Quarto, publishing notebooks, Great Tables, dashboards.\nAnalytics engineering. How to get analysts to use your data models 😓.\n\nI’m open to whatever topics seem most useful, even if they aren’t in the list above.\n\n\n\n\n\n\nScheduling a workshop\n\n\n\nIf you’re a public transit agency, reach out on linkedin or bluesky, and I will send my calendly for scheduling.\n\n\n\n\nCollaboration\nI’m interested in understanding major challenges analytics teams working on public transit face, and the kind of strategic and tooling support they’d most benefit from. If you’re working on analytics in public transit, I would love to hear about what you’re working on, and the tools you use most.\nOne topic I’ve discussed with a few agencies is ghost buses, which is when a bus is scheduled but never shows up. This is an interesting analysis because it combines GTFS schedule data with GTFS-RT realtime bus data.\nAnother is passenger events (e.g. people tapping on or off a bus). This data is challenging because different vendors data record and deliver this data in different ways. This can make it hard for analysts across agencies to discuss analyses—every analysis is different in its own way." }, { "objectID": "blog/open-transit-tools/index.html#in-summary", diff --git a/sitemap.xml b/sitemap.xml index 76686e527..7e04a5fc4 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,542 +2,542 @@ https://posit-dev.github.io/great-tables/blog/introduction-0.2.0/index.html - 2024-12-20T01:38:25.986Z + 2024-12-20T16:02:54.008Z https://posit-dev.github.io/great-tables/blog/introduction-0.4.0/index.html - 2024-12-20T01:38:25.986Z + 2024-12-20T16:02:54.008Z https://posit-dev.github.io/great-tables/blog/design-philosophy/index.html - 2024-12-20T01:38:25.966Z + 2024-12-20T16:02:53.988Z https://posit-dev.github.io/great-tables/blog/rendering-images/index.html - 2024-12-20T01:38:25.992Z + 2024-12-20T16:02:54.014Z https://posit-dev.github.io/great-tables/blog/polars-styling/index.html - 2024-12-20T01:38:25.991Z + 2024-12-20T16:02:54.012Z https://posit-dev.github.io/great-tables/blog/introduction-0.12.0/index.html - 2024-12-20T01:38:25.985Z + 2024-12-20T16:02:54.007Z https://posit-dev.github.io/great-tables/blog/tables-for-scientific-publishing/index.html - 2024-12-20T01:38:25.999Z + 2024-12-20T16:02:54.020Z https://posit-dev.github.io/great-tables/blog/bring-your-own-df/index.html - 2024-12-20T01:38:25.958Z + 2024-12-20T16:02:53.980Z https://posit-dev.github.io/great-tables/get-started/colorizing-with-data.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/table-theme-options.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/table-theme-premade.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/loc-selection.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/basic-stub.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/basic-formatting.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/nanoplots.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/overview.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/articles/intro.html - 2024-12-20T01:38:25.948Z + 2024-12-20T16:02:53.970Z https://posit-dev.github.io/great-tables/reference/GT.opt_table_font.html - 2024-12-20T01:39:24.476Z + 2024-12-20T16:04:15.477Z https://posit-dev.github.io/great-tables/reference/GT.as_raw_html.html - 2024-12-20T01:39:24.502Z + 2024-12-20T16:04:15.504Z https://posit-dev.github.io/great-tables/reference/vals.fmt_bytes.html - 2024-12-20T01:39:24.588Z + 2024-12-20T16:04:15.592Z https://posit-dev.github.io/great-tables/reference/GT.pipe.html - 2024-12-20T01:39:24.514Z + 2024-12-20T16:04:15.516Z https://posit-dev.github.io/great-tables/reference/style.borders.html - 2024-12-20T01:39:24.381Z + 2024-12-20T16:04:15.380Z https://posit-dev.github.io/great-tables/reference/vals.fmt_time.html - 2024-12-20T01:39:24.601Z + 2024-12-20T16:04:15.605Z https://posit-dev.github.io/great-tables/reference/GT.sub_zero.html - 2024-12-20T01:39:24.266Z + 2024-12-20T16:04:15.264Z https://posit-dev.github.io/great-tables/reference/data.gibraltar.html - 2024-12-20T01:39:24.644Z + 2024-12-20T16:04:15.648Z https://posit-dev.github.io/great-tables/reference/data.illness.html - 2024-12-20T01:39:24.649Z + 2024-12-20T16:04:15.653Z https://posit-dev.github.io/great-tables/reference/GT.fmt_icon.html - 2024-12-20T01:39:24.216Z + 2024-12-20T16:04:15.213Z https://posit-dev.github.io/great-tables/reference/GT.fmt_nanoplot.html - 2024-12-20T01:39:24.236Z + 2024-12-20T16:04:15.234Z https://posit-dev.github.io/great-tables/reference/GT.fmt_roman.html - 2024-12-20T01:39:24.155Z + 2024-12-20T16:04:15.151Z https://posit-dev.github.io/great-tables/reference/data.films.html - 2024-12-20T01:39:24.639Z + 2024-12-20T16:04:15.642Z https://posit-dev.github.io/great-tables/reference/loc.column_header.html - 2024-12-20T01:39:24.323Z + 2024-12-20T16:04:15.322Z https://posit-dev.github.io/great-tables/reference/GT.show.html - 2024-12-20T01:39:24.496Z + 2024-12-20T16:04:15.498Z https://posit-dev.github.io/great-tables/reference/GT.fmt_markdown.html - 2024-12-20T01:39:24.187Z + 2024-12-20T16:04:15.185Z https://posit-dev.github.io/great-tables/reference/GT.save.html - 2024-12-20T01:39:24.492Z + 2024-12-20T16:04:15.494Z https://posit-dev.github.io/great-tables/reference/GT.opt_all_caps.html - 2024-12-20T01:39:24.452Z + 2024-12-20T16:04:15.453Z https://posit-dev.github.io/great-tables/reference/style.text.html - 2024-12-20T01:39:24.372Z + 2024-12-20T16:04:15.371Z https://posit-dev.github.io/great-tables/reference/GT.opt_align_table_header.html - 2024-12-20T01:39:24.441Z + 2024-12-20T16:04:15.441Z https://posit-dev.github.io/great-tables/reference/GT.tab_spanner.html - 2024-12-20T01:39:23.958Z + 2024-12-20T16:04:14.955Z https://posit-dev.github.io/great-tables/reference/GT.cols_align.html - 2024-12-20T01:39:24.272Z + 2024-12-20T16:04:15.270Z https://posit-dev.github.io/great-tables/reference/GT.fmt.html - 2024-12-20T01:39:24.243Z + 2024-12-20T16:04:15.241Z https://posit-dev.github.io/great-tables/reference/loc.stub.html - 2024-12-20T01:39:24.337Z + 2024-12-20T16:04:15.336Z https://posit-dev.github.io/great-tables/reference/data.constants.html - 2024-12-20T01:39:24.647Z + 2024-12-20T16:04:15.651Z https://posit-dev.github.io/great-tables/reference/loc.row_groups.html - 2024-12-20T01:39:24.342Z + 2024-12-20T16:04:15.341Z https://posit-dev.github.io/great-tables/reference/data.exibble.html - 2024-12-20T01:39:24.630Z + 2024-12-20T16:04:15.634Z https://posit-dev.github.io/great-tables/reference/data.pizzaplace.html - 2024-12-20T01:39:24.628Z + 2024-12-20T16:04:15.631Z https://posit-dev.github.io/great-tables/reference/loc.stubhead.html - 2024-12-20T01:39:24.319Z + 2024-12-20T16:04:15.318Z https://posit-dev.github.io/great-tables/reference/GT.cols_hide.html - 2024-12-20T01:39:24.304Z + 2024-12-20T16:04:15.303Z https://posit-dev.github.io/great-tables/reference/GT.fmt_bytes.html - 2024-12-20T01:39:24.147Z + 2024-12-20T16:04:15.144Z https://posit-dev.github.io/great-tables/reference/GT.opt_stylize.html - 2024-12-20T01:39:24.482Z + 2024-12-20T16:04:15.484Z https://posit-dev.github.io/great-tables/reference/vals.fmt_date.html - 2024-12-20T01:39:24.595Z + 2024-12-20T16:04:15.598Z https://posit-dev.github.io/great-tables/reference/loc.source_notes.html - 2024-12-20T01:39:24.355Z + 2024-12-20T16:04:15.354Z https://posit-dev.github.io/great-tables/reference/GT.opt_horizontal_padding.html - 2024-12-20T01:39:24.462Z + 2024-12-20T16:04:15.463Z https://posit-dev.github.io/great-tables/reference/loc.subtitle.html - 2024-12-20T01:39:24.316Z + 2024-12-20T16:04:15.314Z https://posit-dev.github.io/great-tables/reference/GT.cols_width.html - 2024-12-20T01:39:24.277Z + 2024-12-20T16:04:15.276Z https://posit-dev.github.io/great-tables/reference/loc.title.html - 2024-12-20T01:39:24.312Z + 2024-12-20T16:04:15.311Z https://posit-dev.github.io/great-tables/reference/vals.fmt_currency.html - 2024-12-20T01:39:24.572Z + 2024-12-20T16:04:15.575Z https://posit-dev.github.io/great-tables/reference/data.photolysis.html - 2024-12-20T01:39:24.656Z + 2024-12-20T16:04:15.660Z https://posit-dev.github.io/great-tables/reference/system_fonts.html - 2024-12-20T01:39:24.408Z + 2024-12-20T16:04:15.408Z https://posit-dev.github.io/great-tables/reference/GT.html - 2024-12-20T01:39:23.943Z + 2024-12-20T16:04:14.940Z https://posit-dev.github.io/great-tables/reference/GT.data_color.html - 2024-12-20T01:39:24.253Z + 2024-12-20T16:04:15.251Z https://posit-dev.github.io/great-tables/reference/GT.with_locale.html - 2024-12-20T01:39:24.387Z + 2024-12-20T16:04:15.386Z https://posit-dev.github.io/great-tables/reference/GT.tab_stubhead.html - 2024-12-20T01:39:23.969Z + 2024-12-20T16:04:14.965Z https://posit-dev.github.io/great-tables/reference/data.gtcars.html - 2024-12-20T01:39:24.622Z + 2024-12-20T16:04:15.626Z https://posit-dev.github.io/great-tables/reference/data.nuclides.html - 2024-12-20T01:39:24.658Z + 2024-12-20T16:04:15.663Z https://posit-dev.github.io/great-tables/reference/data.towny.html - 2024-12-20T01:39:24.633Z + 2024-12-20T16:04:15.637Z https://posit-dev.github.io/great-tables/reference/GT.fmt_scientific.html - 2024-12-20T01:39:24.118Z + 2024-12-20T16:04:15.114Z https://posit-dev.github.io/great-tables/reference/loc.spanner_labels.html - 2024-12-20T01:39:24.328Z + 2024-12-20T16:04:15.327Z https://posit-dev.github.io/great-tables/reference/data.sp500.html - 2024-12-20T01:39:24.625Z + 2024-12-20T16:04:15.628Z https://posit-dev.github.io/great-tables/reference/data.reactions.html - 2024-12-20T01:39:24.652Z + 2024-12-20T16:04:15.656Z https://posit-dev.github.io/great-tables/reference/md.html - 2024-12-20T01:39:24.391Z + 2024-12-20T16:04:15.390Z https://posit-dev.github.io/great-tables/reference/data.countrypops.html - 2024-12-20T01:39:24.616Z + 2024-12-20T16:04:15.620Z https://posit-dev.github.io/great-tables/reference/loc.body.html - 2024-12-20T01:39:24.347Z + 2024-12-20T16:04:15.346Z https://posit-dev.github.io/great-tables/reference/GT.fmt_integer.html - 2024-12-20T01:39:24.089Z + 2024-12-20T16:04:15.085Z https://posit-dev.github.io/great-tables/reference/vals.fmt_image.html - 2024-12-20T01:39:24.613Z + 2024-12-20T16:04:15.617Z https://posit-dev.github.io/great-tables/reference/vals.fmt_integer.html - 2024-12-20T01:39:24.536Z + 2024-12-20T16:04:15.537Z https://posit-dev.github.io/great-tables/reference/GT.fmt_units.html - 2024-12-20T01:39:24.195Z + 2024-12-20T16:04:15.192Z https://posit-dev.github.io/great-tables/reference/vals.fmt_roman.html - 2024-12-20T01:39:24.577Z + 2024-12-20T16:04:15.580Z https://posit-dev.github.io/great-tables/reference/GT.fmt_image.html - 2024-12-20T01:39:24.205Z + 2024-12-20T16:04:15.202Z https://posit-dev.github.io/great-tables/reference/GT.cols_move_to_end.html - 2024-12-20T01:39:24.299Z + 2024-12-20T16:04:15.298Z https://posit-dev.github.io/great-tables/reference/loc.column_labels.html - 2024-12-20T01:39:24.332Z + 2024-12-20T16:04:15.331Z https://posit-dev.github.io/great-tables/reference/GT.tab_options.html - 2024-12-20T01:39:24.062Z + 2024-12-20T16:04:15.058Z https://posit-dev.github.io/great-tables/reference/GT.fmt_date.html - 2024-12-20T01:39:24.164Z + 2024-12-20T16:04:15.161Z https://posit-dev.github.io/great-tables/reference/GT.cols_move.html - 2024-12-20T01:39:24.289Z + 2024-12-20T16:04:15.288Z https://posit-dev.github.io/great-tables/reference/GT.fmt_flag.html - 2024-12-20T01:39:24.224Z + 2024-12-20T16:04:15.221Z https://posit-dev.github.io/great-tables/reference/data.metro.html - 2024-12-20T01:39:24.641Z + 2024-12-20T16:04:15.645Z https://posit-dev.github.io/great-tables/reference/from_column.html - 2024-12-20T01:39:24.399Z + 2024-12-20T16:04:15.398Z https://posit-dev.github.io/great-tables/reference/GT.as_latex.html - 2024-12-20T01:39:24.508Z + 2024-12-20T16:04:15.510Z https://posit-dev.github.io/great-tables/reference/GT.cols_move_to_start.html - 2024-12-20T01:39:24.294Z + 2024-12-20T16:04:15.293Z https://posit-dev.github.io/great-tables/reference/GT.opt_table_outline.html - 2024-12-20T01:39:24.468Z + 2024-12-20T16:04:15.469Z https://posit-dev.github.io/great-tables/reference/GT.tab_header.html - 2024-12-20T01:39:23.949Z + 2024-12-20T16:04:14.946Z https://posit-dev.github.io/great-tables/reference/vals.fmt_scientific.html - 2024-12-20T01:39:24.547Z + 2024-12-20T16:04:15.549Z https://posit-dev.github.io/great-tables/reference/GT.tab_style.html - 2024-12-20T01:39:23.979Z + 2024-12-20T16:04:14.976Z https://posit-dev.github.io/great-tables/reference/index.html - 2024-12-20T01:39:23.894Z + 2024-12-20T16:04:14.891Z https://posit-dev.github.io/great-tables/reference/GT.with_id.html - 2024-12-20T01:39:24.384Z + 2024-12-20T16:04:15.383Z https://posit-dev.github.io/great-tables/reference/GT.fmt_time.html - 2024-12-20T01:39:24.173Z + 2024-12-20T16:04:15.170Z https://posit-dev.github.io/great-tables/reference/GT.tab_stub.html - 2024-12-20T01:39:23.964Z + 2024-12-20T16:04:14.960Z https://posit-dev.github.io/great-tables/reference/GT.fmt_number.html - 2024-12-20T01:39:24.077Z + 2024-12-20T16:04:15.073Z https://posit-dev.github.io/great-tables/reference/html.html - 2024-12-20T01:39:24.395Z + 2024-12-20T16:04:15.394Z https://posit-dev.github.io/great-tables/reference/vals.fmt_markdown.html - 2024-12-20T01:39:24.605Z + 2024-12-20T16:04:15.609Z https://posit-dev.github.io/great-tables/reference/vals.fmt_number.html - 2024-12-20T01:39:24.527Z + 2024-12-20T16:04:15.528Z https://posit-dev.github.io/great-tables/reference/data.peeps.html - 2024-12-20T01:39:24.636Z + 2024-12-20T16:04:15.639Z https://posit-dev.github.io/great-tables/reference/define_units.html - 2024-12-20T01:39:24.413Z + 2024-12-20T16:04:15.413Z https://posit-dev.github.io/great-tables/reference/nanoplot_options.html - 2024-12-20T01:39:24.436Z + 2024-12-20T16:04:15.436Z https://posit-dev.github.io/great-tables/reference/data.sza.html - 2024-12-20T01:39:24.619Z + 2024-12-20T16:04:15.623Z https://posit-dev.github.io/great-tables/reference/GT.opt_row_striping.html - 2024-12-20T01:39:24.446Z + 2024-12-20T16:04:15.447Z https://posit-dev.github.io/great-tables/reference/GT.tab_source_note.html - 2024-12-20T01:39:23.974Z + 2024-12-20T16:04:14.970Z https://posit-dev.github.io/great-tables/reference/GT.fmt_percent.html - 2024-12-20T01:39:24.104Z + 2024-12-20T16:04:15.099Z https://posit-dev.github.io/great-tables/reference/loc.footer.html - 2024-12-20T01:39:24.351Z + 2024-12-20T16:04:15.350Z https://posit-dev.github.io/great-tables/reference/style.fill.html - 2024-12-20T01:39:24.359Z + 2024-12-20T16:04:15.358Z https://posit-dev.github.io/great-tables/reference/GT.fmt_currency.html - 2024-12-20T01:39:24.133Z + 2024-12-20T16:04:15.129Z https://posit-dev.github.io/great-tables/reference/loc.header.html - 2024-12-20T01:39:24.308Z + 2024-12-20T16:04:15.307Z https://posit-dev.github.io/great-tables/reference/GT.sub_missing.html - 2024-12-20T01:39:24.260Z + 2024-12-20T16:04:15.258Z https://posit-dev.github.io/great-tables/reference/google_font.html - 2024-12-20T01:39:24.403Z + 2024-12-20T16:04:15.403Z https://posit-dev.github.io/great-tables/reference/GT.cols_label.html - 2024-12-20T01:39:24.283Z + 2024-12-20T16:04:15.282Z https://posit-dev.github.io/great-tables/reference/GT.fmt_datetime.html - 2024-12-20T01:39:24.181Z + 2024-12-20T16:04:15.179Z https://posit-dev.github.io/great-tables/reference/GT.opt_vertical_padding.html - 2024-12-20T01:39:24.457Z + 2024-12-20T16:04:15.458Z https://posit-dev.github.io/great-tables/reference/vals.fmt_percent.html - 2024-12-20T01:39:24.559Z + 2024-12-20T16:04:15.562Z https://posit-dev.github.io/great-tables/get-started/row-selection.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/basic-styling.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/contributing.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/column-selection.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/targeted-styles.html - 2024-12-20T01:38:26.001Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/basic-header.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/index.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/get-started/basic-column-labels.html - 2024-12-20T01:38:26.000Z + 2024-12-20T16:02:54.022Z https://posit-dev.github.io/great-tables/examples/index.html - 2024-12-20T01:38:25.999Z + 2024-12-20T16:02:54.021Z https://posit-dev.github.io/great-tables/blog/pycon-2024-great-tables-are-possible/index.html - 2024-12-20T01:38:25.991Z + 2024-12-20T16:02:54.013Z https://posit-dev.github.io/great-tables/blog/latex-output-tables/index.html - 2024-12-20T01:38:25.988Z + 2024-12-20T16:02:54.010Z https://posit-dev.github.io/great-tables/blog/open-transit-tools/index.html - 2024-12-20T01:38:25.990Z + 2024-12-20T16:02:54.012Z https://posit-dev.github.io/great-tables/blog/introduction-0.13.0/index.html - 2024-12-20T01:38:25.986Z + 2024-12-20T16:02:54.007Z https://posit-dev.github.io/great-tables/blog/introduction-0.3.0/index.html - 2024-12-20T01:38:25.986Z + 2024-12-20T16:02:54.008Z https://posit-dev.github.io/great-tables/blog/introduction_great_tables.html - 2024-12-20T01:38:25.986Z + 2024-12-20T16:02:54.008Z https://posit-dev.github.io/great-tables/blog/index.html - 2024-12-20T01:38:25.985Z + 2024-12-20T16:02:54.007Z https://posit-dev.github.io/great-tables/blog/introduction-0.15.0/index.html - 2024-12-20T01:38:25.986Z + 2024-12-20T16:02:54.008Z https://posit-dev.github.io/great-tables/blog/superbowl-squares/index.html - 2024-12-20T01:38:25.998Z + 2024-12-20T16:02:54.020Z