# Rendering images anywhere in Great Tables

Rendering images in Great Tables is straightforward with [GT.fmt_image()](../../reference/GT.fmt_image.md#great_tables.GT.fmt_image) and [vals.fmt_image()](../../reference/vals.fmt_image.md#great_tables.vals.fmt_image). In this post, we'll explore three key topics:

- Four examples demonstrating how to render images within the body using [GT.fmt_image()](../../reference/GT.fmt_image.md#great_tables.GT.fmt_image).
- How to render images anywhere using [vals.fmt_image()](../../reference/vals.fmt_image.md#great_tables.vals.fmt_image) and [html()](../../reference/html.md#great_tables.html).
- How to manually render images anywhere using [html()](../../reference/html.md#great_tables.html).


# Rendering Images in the Body

[GT.fmt_image()](https://posit-dev.github.io/great-tables/reference/GT.fmt_image.html#great_tables.GT.fmt_image) is the go-to tool for rendering images within the body of a table. Below, we'll present four examples corresponding to the cases outlined in the documentation:

- **Case 1**: Local file paths.
- **Case 2**: Full HTTP/HTTPS URLs.
- **Case 3**: Image names with the `path=` argument.
- **Case 4**: Image names using both the `path=` and `file_pattern=` arguments.

> **Tip: Finding the Right Case for Your Needs**
>
> - **Case 1** and **Case 2** work best for data sourced directly from a database.
> - **Case 3** is ideal for users dealing with image names relative to a base directory or URL (e.g., `/path/to/images`).
> - **Case 4** is tailored for users working with patterned image names (e.g., `metro_{}.svg`).


## Preparations

For this demonstration, we'll use the first five rows of the built-in [metro](https://posit-dev.github.io/great-tables/reference/data.metro.html#great_tables.data.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

``` python
import pandas as pd
from great_tables import GT, vals, html
from importlib_resources import files

pd.set_option('display.max_colwidth', 150)

data = {
    "name": [
        "Argentine",
        "Bastille",
        "Bérault",
        "Champs-Élysées--Clemenceau",
        "Charles de Gaulle--Étoile",
    ],
    "lines": ["1", "1, 5, 8", "1", "1, 13", "1, 2, 6"],
}

print("""\
data = {
    "name": [
        "Argentine",
        "Bastille",
        "Bérault",
        "Champs-Élysées--Clemenceau",
        "Charles de Gaulle--Étoile",
    ],
    "lines": ["1", "1, 5, 8", "1", "1, 13", "1, 2, 6"],
}\
""")
```


    data = {
        "name": [
            "Argentine",
            "Bastille",
            "Bérault",
            "Champs-Élysées--Clemenceau",
            "Charles de Gaulle--Étoile",
        ],
        "lines": ["1", "1, 5, 8", "1", "1, 13", "1, 2, 6"],
    }


Attentive readers may have noticed that the values for the key `lines` are lists of strings, each containing one or more numbers separated by commas. [GT.fmt_image()](../../reference/GT.fmt_image.md#great_tables.GT.fmt_image) is specifically designed to handle such cases, allowing users to render multiple images in a single row.


## 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:


``` python
1img_local_paths = files("great_tables") / "data/metro_images"
```


1  
<span data-code-cell="annotated-cell-2" data-code-lines="1" data-code-annotation="1">These image files follow a patterned naming convention, such as `metro_1.svg`, `metro_2.svg`, and so on.</span>


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

``` python
metro_mini1 = pd.DataFrame(
    {
        **data,
        "case1": [
            ", ".join(
                str((img_local_paths / f"metro_{item}").with_suffix(".svg"))
                for item in row.split(", ")
            )
            for row in data["lines"]
        ],
    }
)
metro_mini1
```


|  | name | lines | case1 |
|----|----|----|----|
| 0 | Argentine | 1 | /Users/riannone/py_projects/great-tables/great_tables/data/metro_images/metro_1.svg |
| 1 | Bastille | 1, 5, 8 | /Users/riannone/py_projects/great-tables/great_tables/data/metro_images/metro_1.svg, /Users/riannone/py_projects/great-tables/great_tables/data/me... |
| 2 | Bérault | 1 | /Users/riannone/py_projects/great-tables/great_tables/data/metro_images/metro_1.svg |
| 3 | Champs-Élysées--Clemenceau | 1, 13 | /Users/riannone/py_projects/great-tables/great_tables/data/metro_images/metro_1.svg, /Users/riannone/py_projects/great-tables/great_tables/data/me... |
| 4 | Charles de Gaulle--Étoile | 1, 2, 6 | /Users/riannone/py_projects/great-tables/great_tables/data/metro_images/metro_1.svg, /Users/riannone/py_projects/great-tables/great_tables/data/me... |


> **Tip: Use the `pathlib` Module to Construct Paths**
>
> 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](https://docs.python.org/3/library/pathlib.html) module to construct paths first and then convert them to strings. In this example, `img_local_paths` is actually an instance of `pathlib.Path`.
>
> <div id="6fcee582" class="cell" data-execution_count="4">
>
> ``` python
> from pathlib import Path
>
> isinstance(img_local_paths, Path)  # 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()](../../reference/GT.fmt_image.md#great_tables.GT.fmt_image) to render images by passing `"case1"` as the first argument:
>
> <div id="a8a8808b" class="cell" data-execution_count="5">
>
> ``` python
> GT(metro_mini1).fmt_image("case1").cols_align(align="right", columns="case1")
> ```
>
> <div class="cell-output cell-output-display" data-execution_count="4">
>
> <div id="smupxkhlud" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
>
> <style>
> #smupxkhlud table {
>           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;
>         }
>
> #smupxkhlud thead, tbody, tfoot, tr, td, th { border-style: none; }
>  tr { background-color: transparent; }
> #smupxkhlud p { margin: 0; padding: 0; }
>  #smupxkhlud .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; }
>  #smupxkhlud .gt_caption { padding-top: 4px; padding-bottom: 4px; }
>  #smupxkhlud .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
>  #smupxkhlud .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
>  #smupxkhlud .gt_heading { background-color: #FFFFFF; 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; }
>  #smupxkhlud .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
>  #smupxkhlud .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; }
>  #smupxkhlud .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: 5px; padding-right: 5px; overflow-x: hidden; }
>  #smupxkhlud .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; }
>  #smupxkhlud .gt_column_spanner_outer:first-child { padding-left: 0; }
>  #smupxkhlud .gt_column_spanner_outer:last-child { padding-right: 0; }
>  #smupxkhlud .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%; }
>  #smupxkhlud .gt_spanner_row { border-bottom-style: hidden; }
>  #smupxkhlud .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; 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; }
>  #smupxkhlud .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; }
>  #smupxkhlud .gt_from_md> :first-child { margin-top: 0; }
>  #smupxkhlud .gt_from_md> :last-child { margin-bottom: 0; }
>  #smupxkhlud .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-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; overflow-x: hidden; }
>  #smupxkhlud .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: 5px; padding-right: 5px; }
>  #smupxkhlud .gt_indent_1 { text-indent: 5px; }
>  #smupxkhlud .gt_indent_2 { text-indent: calc(5px * 2); }
>  #smupxkhlud .gt_indent_3 { text-indent: calc(5px * 3); }
>  #smupxkhlud .gt_indent_4 { text-indent: calc(5px * 4); }
>  #smupxkhlud .gt_indent_5 { text-indent: calc(5px * 5); }
>  #smupxkhlud .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: 5px; padding-right: 5px; vertical-align: top; }
>  #smupxkhlud .gt_row_group_first td { border-top-width: 2px; }
>  #smupxkhlud .gt_row_group_first th { border-top-width: 2px; }
>  #smupxkhlud .gt_striped { color: #333333; background-color: #F4F4F4; }
>  #smupxkhlud .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; }
>  #smupxkhlud .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
>  #smupxkhlud .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
>  #smupxkhlud .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
>  #smupxkhlud .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
>  #smupxkhlud .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
>  #smupxkhlud .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
>  #smupxkhlud .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; }
>  #smupxkhlud .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
>  #smupxkhlud .gt_left { text-align: left; }
>  #smupxkhlud .gt_center { text-align: center; }
>  #smupxkhlud .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
>  #smupxkhlud .gt_font_normal { font-weight: normal; }
>  #smupxkhlud .gt_font_bold { font-weight: bold; }
>  #smupxkhlud .gt_font_italic { font-style: italic; }
>  #smupxkhlud .gt_super { font-size: 65%; }
>  #smupxkhlud .gt_footnotes { color: font-color(#FFFFFF); 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; }
>  #smupxkhlud .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
>  #smupxkhlud .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; }
>  #smupxkhlud .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
>  #smupxkhlud .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
>  #smupxkhlud .gt_asterisk { font-size: 100%; vertical-align: 0; }
>  
> </style>
>
> | name | lines | case1 |
> |----|----|----|
> | Argentine | 1 | <span style="white-space:nowrap;"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDEwNTAgMTA1MCIgc3R5bGU9ImhlaWdodDoxZW07d2lkdGg6MS4xM2VtO3ZlcnRpY2FsLWFsaWduOi0wLjEyNWVtO21hcmdpbi1sZWZ0OmF1dG87bWFyZ2luLXJpZ2h0OmF1dG87Zm9udC1zaXplOmluaGVyaXQ7b3ZlcmZ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3LjM1NyA5MC42OC01MS43djQxNi41OTFoMTEyLjU2NCIvPjwvc3ZnPg==" style="height: 2em;vertical-align: middle;" /> <img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDEwNTAgMTA1MCIgc3R5bGU9ImhlaWdodDoxZW07d2lkdGg6MS4xM2VtO3ZlcnRpY2FsLWFsaWduOi0wLjEyNWVtO21hcmdpbi1sZWZ0OmF1dG87bWFyZ2luLXJpZ2h0OmF1dG87Zm9udC1zaXplOmluaGVyaXQ7b3ZlcmZsb3c6dmlzaWJsZTtwb3NpdGlvbjpyZWxhdGl2ZTsiPjxjaXJjbGUgZmlsbD0iI0YxOTA0MyIgY3g9IjUwMCIgY3k9IjUwMCIgcj0iNTAwIi8+PHBhdGggZmlsbD0iIzIzMUYyMCIgZD0iTTY3OS43MSA1OTIuNzVjMC03OS40ODYtNTguNDItMTU5LjY4LTIwMy4yNy0xNjcuMjVsLTE1LjEzMy0uNzEyIDcuNDE4LTEwMS4zNTFoMTkwLjc4di04Ny45MTNoLTI3OC41MmwtMjEuMDM2IDI3NS40OSA4Mi41NDIuNzEyYzk3LjYxMy45NzkgMTIyLjk3OSA1My4zMTcgMTIyLjk3OSA5MS42NSAwIDYyLjE2LTUxLjYyNyA4NS42MjktOTIuODY2IDg1LjYyOS00NS4xODggMC03NS4wMzctMTYuNjE1LTEwMC42MS0zMy45MTJsLTM4Ljg5NyA4Mi42OWM0MS4wOTMgMjMuMTcyIDg5LjI3NyAzOC4zMzMgMTQ1LjUgMzguMzMzIDEyMC43NzEtLjA0IDIwMS4xMi04Mi4wOCAyMDEuMTItMTgzLjM3Ii8+PC9zdmc+" style="height: 2em;vertical-align: middle;" /> <img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDE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1OS03OS41NS04NC44OTYgMC00MS4xODggMzQuNTM5LTc1LjcwNSA2OS4wNTgtODkuMzE4IDQ0Ljk5IDIyLjU0IDg4LjU5IDQ4LjggODguNTkgOTYuODVsLS4wMDMtLjAwOXoiLz48L3N2Zz4=" style="height: 2em;vertical-align: middle;" /></span> |
> | Bérault | 1 | <span style="white-space:nowrap;"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDEwNTAgMTA1MCIgc3R5bGU9ImhlaWdodDoxZW07d2lkdGg6MS4xM2VtO3ZlcnRpY2FsLWFsaWduOi0wLjEyNWVtO21hcmdpbi1sZWZ0OmF1dG87bWFyZ2luLXJpZ2h0OmF1dG87Zm9udC1zaXplOmluaGVyaXQ7b3ZlcmZsb3c6dmlzaWJsZTtwb3NpdGlvbjpyZWxhdGl2ZTsiPjxjaXJjbGUgZmlsbD0iI0ZFQ0UwMCIgY3g9IjUwMCIgY3k9IjUwMCIgcj0iNTAwIi8+PHBhdGggZmlsbD0iIzIyMUUyMCIgZD0iTTU3Ny4wMjYgNzYzLjk4N1YyMzQuMDIyaC05Mi4zNTJjLTIzLjkzOCAxOC43MTQtODEuMDE3IDU0LjAyNi0xNDIuNTY1IDgzLjI2NWwtMzIuMjg3IDE1LjE0NyAzNi4wMTQgODEuMDQyIDI3Ljk0Ni0xNC4zOGMxOS4zNzgtOS42MTEgNzIuNjE3LTM3LjM1NyA5MC42OC01MS43djQxNi41OTFoMTEyLjU2NCIvPjwvc3ZnPg==" style="height: 2em;vertical-align: middle;" /></span> |
> | Champs-Élysées--Clemenceau | 1, 13 | <span style="white-space:nowrap;"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDEwNTAgMTA1MCIgc3R5bGU9ImhlaWdodDoxZW07d2l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iAxNC45NzQgMzYuMDk2IDgxLjYgMjcuNzc2LTE0LjI2YzE5LjQ1Ni05Ljc0NSA3Mi44MjgtMzcuNDM1IDkwLjc3Ny01MS42MTN2NDE2LjI4aDExMi43Mk04MjEuMjIgNjA2LjkzYzAtNzQuMTUxLTQ0LjI5Ny0xMTcuNTY5LTEwMi44NTktMTI4Ljg1OXYtMS40NjVjNTYuMjY2LTIwLjk5NCA4NS40MjgtNjIuODYzIDg1LjQyOC0xMTcuNTcgMC03MS4xNDMtNjEuNDk1LTEzNC4wNC0xNjkuNTEtMTM0LjA0LTYyLjQ0NyAwLTExMy4zOCAxNy4yNy0xNTkuMTUgNDcuMjE3bDM2LjcxMSA3Ny44NzdjMTcuMjM2LTE0LjIyMSA0OS40NS0zOC4xODYgOTguMzQ2LTM4LjE4NiA1NS41OTMgMCA4MS4wMjkgMjkuOTg1IDgxLjAyOSA2My42OTQgMCA0MC4zMjQtMzIuMjEzIDY1Ljg3NS04NC4xMjEgNjUuODc1SDU1MS41OHY4Ny41OGg1NC44MDFjNTQuMjAzIDAgMTAwLjY0IDE5LjQ0OSAxMDAuNjQgODAuMDk3IDAgNDQuOTItMzguMTk3IDc4LjY3LTk5LjkzMiA3OC42Ny00NC43NzQgMC04MS42MDQtMTcuMjcxLTEwNC4xNy0zNC40NjRsLTQwLjU5NiA4MS42MDFjNDIuNzk0IDIzLjkyNiA4NC4wNjIgMzkuNjEzIDE1Mi4zNyAzOS42MTMgMTIzLjE0OS0uMDExIDIwNi41Mi03NC44ODEgMjA2LjUyLTE2Ny42NWwuMDA3LjAxeiIvPjwvc3ZnPg==" style="height: 2em;vertical-align: middle;" /></span> |
> | Charles de Gaulle--Étoile | 1, 2, 6 | <span style="white-space:nowrap;"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDEwNTAgMTA1MCIgc3R5bGU9ImhlaWdodDoxZW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IDEyLjg5MWwxNi42Ni05MC4xMTVjLTIxLjcxMy01LjQxNy00OC45MTYtOC45MzQtNzguODMtOC45MzQtMTY2LjU5IDAtMjUxLjM2IDEyNS44OTEtMjUxLjM2IDMwOS44OTEgMCAxNDAuMzUgNTAuODk1IDI0MC4zMSAxOTMuNTggMjQwLjMxIDEwOC44OS0uMDAxIDE3OS40MS03Ny41NjEgMTc5LjQwOS0xODMuMjMxbS0xMDUuODA5IDExLjI4YzAgNDUuNjI1LTI2LjI1NCA4OC40My03Ny40MDEgODguNDMtNTIuNTc4IDAtODAuOTUzLTQ4Ljc3Mi04MC45NTMtOTkuMTIgMC0xNS42MzggMC0zNS45NTkgNi4wMDQtNDQuOTY4IDEwLjQ3MS0xNi41ODYgMzYuNzk3LTI5LjE4NCA2OS4wNTUtMjkuMTg0IDUwLjkyIDAgODMuMjkgMzUuMTkgODMuMjkgODQuODRsLjAwNS4wMDJ6Ii8+PC9zdmc+" style="height: 2em;vertical-align: middle;" /></span> |
>
> </div>
>
> </div>
>
> </div>
>
> <div id="case-2-full-httphttps-urls" class="section level2">
>
> ## 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:
>
> <div id="8ebf84c9" class="cell" data-execution_count="6">
>
> ``` python
> img_url_paths = "https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images"
> ```
>
> </div>
>
> Below is a `Pandas` DataFrame called `metro_mini2`, where the `case2` column contains full HTTP/HTTPS URLs that we aim to render as images.
>
> <div id="08f6d2ba" class="cell" data-execution_count="7">
>
> Show the Code
>
> ``` python
> metro_mini2 = pd.DataFrame(
>     {
>         **data,
>         "case2": [
>             ", ".join(f"{img_url_paths}/metro_{item}.svg" for item in row.split(", "))
>             for row in data["lines"]
>         ],
>     }
> )
> metro_mini2
> ```
>
> <div class="cell-output cell-output-display" data-execution_count="6">
>
> <div>
>
> |  | name | lines | case2 |
> |----|----|----|----|
> | 0 | Argentine | 1 | https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg |
> | 1 | Bastille | 1, 5, 8 | https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg, https://raw.githubusercontent... |
> | 2 | Bérault | 1 | https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg |
> | 3 | Champs-Élysées--Clemenceau | 1, 13 | https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg, https://raw.githubusercontent... |
> | 4 | Charles de Gaulle--Étoile | 1, 2, 6 | https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg, https://raw.githubusercontent... |
>
> </div>
>
> </div>
>
> </div>
>
> The lengthy `case2` column issue can also be addressed using the trick shared in **Case 3**.
>
> Similarly, we can use [GT.fmt_image()](../../reference/GT.fmt_image.md#great_tables.GT.fmt_image) to render images by passing `"case2"` as the first argument:
>
> <div id="5eaca417" class="cell" data-execution_count="8">
>
> ``` python
> GT(metro_mini2).fmt_image("case2").cols_align(align="right", columns="case2")
> ```
>
> <div class="cell-output cell-output-display" data-execution_count="7">
>
> <div id="nzeclscned" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
>
> <style>
> #nzeclscned table {
>           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;
>         }
>
> #nzeclscned thead, tbody, tfoot, tr, td, th { border-style: none; }
>  tr { background-color: transparent; }
> #nzeclscned p { margin: 0; padding: 0; }
>  #nzeclscned .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; }
>  #nzeclscned .gt_caption { padding-top: 4px; padding-bottom: 4px; }
>  #nzeclscned .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
>  #nzeclscned .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
>  #nzeclscned .gt_heading { background-color: #FFFFFF; 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; }
>  #nzeclscned .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
>  #nzeclscned .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; }
>  #nzeclscned .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: 5px; padding-right: 5px; overflow-x: hidden; }
>  #nzeclscned .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; }
>  #nzeclscned .gt_column_spanner_outer:first-child { padding-left: 0; }
>  #nzeclscned .gt_column_spanner_outer:last-child { padding-right: 0; }
>  #nzeclscned .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%; }
>  #nzeclscned .gt_spanner_row { border-bottom-style: hidden; }
>  #nzeclscned .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; 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; }
>  #nzeclscned .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; }
>  #nzeclscned .gt_from_md> :first-child { margin-top: 0; }
>  #nzeclscned .gt_from_md> :last-child { margin-bottom: 0; }
>  #nzeclscned .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-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; overflow-x: hidden; }
>  #nzeclscned .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: 5px; padding-right: 5px; }
>  #nzeclscned .gt_indent_1 { text-indent: 5px; }
>  #nzeclscned .gt_indent_2 { text-indent: calc(5px * 2); }
>  #nzeclscned .gt_indent_3 { text-indent: calc(5px * 3); }
>  #nzeclscned .gt_indent_4 { text-indent: calc(5px * 4); }
>  #nzeclscned .gt_indent_5 { text-indent: calc(5px * 5); }
>  #nzeclscned .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: 5px; padding-right: 5px; vertical-align: top; }
>  #nzeclscned .gt_row_group_first td { border-top-width: 2px; }
>  #nzeclscned .gt_row_group_first th { border-top-width: 2px; }
>  #nzeclscned .gt_striped { color: #333333; background-color: #F4F4F4; }
>  #nzeclscned .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; }
>  #nzeclscned .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
>  #nzeclscned .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
>  #nzeclscned .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
>  #nzeclscned .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
>  #nzeclscned .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
>  #nzeclscned .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
>  #nzeclscned .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; }
>  #nzeclscned .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
>  #nzeclscned .gt_left { text-align: left; }
>  #nzeclscned .gt_center { text-align: center; }
>  #nzeclscned .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
>  #nzeclscned .gt_font_normal { font-weight: normal; }
>  #nzeclscned .gt_font_bold { font-weight: bold; }
>  #nzeclscned .gt_font_italic { font-style: italic; }
>  #nzeclscned .gt_super { font-size: 65%; }
>  #nzeclscned .gt_footnotes { color: font-color(#FFFFFF); 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; }
>  #nzeclscned .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
>  #nzeclscned .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; }
>  #nzeclscned .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
>  #nzeclscned .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
>  #nzeclscned .gt_asterisk { font-size: 100%; vertical-align: 0; }
>  
> </style>
>
> | name | lines | case2 |
> |----|----|----|
> | Argentine | 1 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /></span> |
> | Bastille | 1, 5, 8 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_5.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_8.svg" style="height: 2em;vertical-align: middle;" /></span> |
> | Bérault | 1 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /></span> |
> | Champs-Élysées--Clemenceau | 1, 13 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_13.svg" style="height: 2em;vertical-align: middle;" /></span> |
> | Charles de Gaulle--Étoile | 1, 2, 6 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_2.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_6.svg" style="height: 2em;vertical-align: middle;" /></span> |
>
> </div>
>
> </div>
>
> </div>
>
> <div id="case-3-image-names-with-the-path-argument" class="section level2">
>
> ## 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.
>
> <div id="40eb14f5" class="cell" data-execution_count="9">
>
> Show the Code
>
> ``` python
> metro_mini3 = pd.DataFrame(
>     {
>         **data,
>         "case3": [
>             ", ".join(f"metro_{item}.svg" for item in row.split(", ")) for row in data["lines"]
>         ],
>     }
> )
> metro_mini3
> ```
>
> <div class="cell-output cell-output-display" data-execution_count="8">
>
> <div>
>
> |     | name                      | lines   | case3                                 |
> |-----|---------------------------|---------|---------------------------------------|
> | 0   | Argentine                 | 1       | metro_1.svg                           |
> | 1   | Bastille                  | 1, 5, 8 | metro_1.svg, metro_5.svg, metro_8.svg |
> | 2   | Bérault                   | 1       | metro_1.svg                           |
> | 3   | Champs-Élysées--Clemenceau | 1, 13   | metro_1.svg, metro_13.svg             |
> | 4   | Charles de Gaulle--Étoile  | 1, 2, 6 | metro_1.svg, metro_2.svg, metro_6.svg |
>
> </div>
>
> </div>
>
> </div>
>
> Now we can use [GT.fmt_image()](../../reference/GT.fmt_image.md#great_tables.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:
>
> <div id="81296270" class="cell" data-execution_count="10">
>
> ``` python
> # equivalent to `Case 1`
> (
>     GT(metro_mini3)
>     .fmt_image("case3", path=img_local_paths)
>     .cols_align(align="right", columns="case3")
> )
>
> # equivalent to `Case 2`
> (
>     GT(metro_mini3)
>     .fmt_image("case3", path=img_url_paths)
>     .cols_align(align="right", columns="case3")
> )
> ```
>
> <div class="cell-output cell-output-display" data-execution_count="9">
>
> <div id="kiqtmjbmul" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
>
> <style>
> #kiqtmjbmul table {
>           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;
>         }
>
> #kiqtmjbmul thead, tbody, tfoot, tr, td, th { border-style: none; }
>  tr { background-color: transparent; }
> #kiqtmjbmul p { margin: 0; padding: 0; }
>  #kiqtmjbmul .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; }
>  #kiqtmjbmul .gt_caption { padding-top: 4px; padding-bottom: 4px; }
>  #kiqtmjbmul .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
>  #kiqtmjbmul .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
>  #kiqtmjbmul .gt_heading { background-color: #FFFFFF; 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; }
>  #kiqtmjbmul .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
>  #kiqtmjbmul .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; }
>  #kiqtmjbmul .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: 5px; padding-right: 5px; overflow-x: hidden; }
>  #kiqtmjbmul .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; }
>  #kiqtmjbmul .gt_column_spanner_outer:first-child { padding-left: 0; }
>  #kiqtmjbmul .gt_column_spanner_outer:last-child { padding-right: 0; }
>  #kiqtmjbmul .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%; }
>  #kiqtmjbmul .gt_spanner_row { border-bottom-style: hidden; }
>  #kiqtmjbmul .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; 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; }
>  #kiqtmjbmul .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; }
>  #kiqtmjbmul .gt_from_md> :first-child { margin-top: 0; }
>  #kiqtmjbmul .gt_from_md> :last-child { margin-bottom: 0; }
>  #kiqtmjbmul .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-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; overflow-x: hidden; }
>  #kiqtmjbmul .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: 5px; padding-right: 5px; }
>  #kiqtmjbmul .gt_indent_1 { text-indent: 5px; }
>  #kiqtmjbmul .gt_indent_2 { text-indent: calc(5px * 2); }
>  #kiqtmjbmul .gt_indent_3 { text-indent: calc(5px * 3); }
>  #kiqtmjbmul .gt_indent_4 { text-indent: calc(5px * 4); }
>  #kiqtmjbmul .gt_indent_5 { text-indent: calc(5px * 5); }
>  #kiqtmjbmul .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: 5px; padding-right: 5px; vertical-align: top; }
>  #kiqtmjbmul .gt_row_group_first td { border-top-width: 2px; }
>  #kiqtmjbmul .gt_row_group_first th { border-top-width: 2px; }
>  #kiqtmjbmul .gt_striped { color: #333333; background-color: #F4F4F4; }
>  #kiqtmjbmul .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; }
>  #kiqtmjbmul .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
>  #kiqtmjbmul .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
>  #kiqtmjbmul .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
>  #kiqtmjbmul .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
>  #kiqtmjbmul .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
>  #kiqtmjbmul .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
>  #kiqtmjbmul .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; }
>  #kiqtmjbmul .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
>  #kiqtmjbmul .gt_left { text-align: left; }
>  #kiqtmjbmul .gt_center { text-align: center; }
>  #kiqtmjbmul .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
>  #kiqtmjbmul .gt_font_normal { font-weight: normal; }
>  #kiqtmjbmul .gt_font_bold { font-weight: bold; }
>  #kiqtmjbmul .gt_font_italic { font-style: italic; }
>  #kiqtmjbmul .gt_super { font-size: 65%; }
>  #kiqtmjbmul .gt_footnotes { color: font-color(#FFFFFF); 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; }
>  #kiqtmjbmul .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
>  #kiqtmjbmul .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; }
>  #kiqtmjbmul .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
>  #kiqtmjbmul .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
>  #kiqtmjbmul .gt_asterisk { font-size: 100%; vertical-align: 0; }
>  
> </style>
>
> | name | lines | case3 |
> |----|----|----|
> | Argentine | 1 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /></span> |
> | Bastille | 1, 5, 8 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_5.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_8.svg" style="height: 2em;vertical-align: middle;" /></span> |
> | Bérault | 1 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /></span> |
> | Champs-Élysées--Clemenceau | 1, 13 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_13.svg" style="height: 2em;vertical-align: middle;" /></span> |
> | Charles de Gaulle--Étoile | 1, 2, 6 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_2.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_6.svg" style="height: 2em;vertical-align: middle;" /></span> |
>
> </div>
>
> </div>
>
> </div>
>
> After exploring **Case 1** and **Case 2**, you'll likely appreciate the functionality of the `path=` argument. However, manually constructing file names can still be a bit tedious. If your file names follow a consistent pattern, the `file_pattern=` argument can simplify the process. Let's see how this works in **Case 4** below.
>
> <div id="case-4-image-names-using-both-the-path-and-file_pattern-arguments" class="section level2">
>
> ## 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.
>
> <div id="5b06cd02" class="cell" data-execution_count="11">
>
> Show the Code
>
> ``` python
> metro_mini4 = pd.DataFrame({**data, "case4": data["lines"]})
> metro_mini4
> ```
>
> <div class="cell-output cell-output-display" data-execution_count="10">
>
> <div>
>
> |     | name                      | lines   | case4   |
> |-----|---------------------------|---------|---------|
> | 0   | Argentine                 | 1       | 1       |
> | 1   | Bastille                  | 1, 5, 8 | 1, 5, 8 |
> | 2   | Bérault                   | 1       | 1       |
> | 3   | Champs-Élysées--Clemenceau | 1, 13   | 1, 13   |
> | 4   | Charles de Gaulle--Étoile  | 1, 2, 6 | 1, 2, 6 |
>
> </div>
>
> </div>
>
> </div>
>
> First, define a string pattern to illustrate the file naming convention, using `{}` to indicate the variable portion:
>
> <div id="7d0f979f" class="cell" data-execution_count="12">
>
> ``` python
> file_pattern = "metro_{}.svg"
> ```
>
> </div>
>
> 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()](../../reference/GT.fmt_image.md#great_tables.GT.fmt_image) to render the images:
>
> <div id="b06b1fdd" class="cell" data-execution_count="13">
>
> ``` python
> # equivalent to `Case 1`
> (
>     GT(metro_mini4)
>     .fmt_image("case4", path=img_local_paths, file_pattern=file_pattern)
>     .cols_align(align="right", columns="case4")
> )
>
> # equivalent to `Case 2`
> (
>     GT(metro_mini4)
>     .fmt_image("case4", path=img_url_paths, file_pattern=file_pattern)
>     .cols_align(align="right", columns="case4")
> )
> ```
>
> <div class="cell-output cell-output-display" data-execution_count="12">
>
> <div id="bezstthztt" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
>
> <style>
> #bezstthztt table {
>           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;
>         }
>
> #bezstthztt thead, tbody, tfoot, tr, td, th { border-style: none; }
>  tr { background-color: transparent; }
> #bezstthztt p { margin: 0; padding: 0; }
>  #bezstthztt .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; }
>  #bezstthztt .gt_caption { padding-top: 4px; padding-bottom: 4px; }
>  #bezstthztt .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
>  #bezstthztt .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
>  #bezstthztt .gt_heading { background-color: #FFFFFF; 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; }
>  #bezstthztt .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
>  #bezstthztt .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; }
>  #bezstthztt .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: 5px; padding-right: 5px; overflow-x: hidden; }
>  #bezstthztt .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; }
>  #bezstthztt .gt_column_spanner_outer:first-child { padding-left: 0; }
>  #bezstthztt .gt_column_spanner_outer:last-child { padding-right: 0; }
>  #bezstthztt .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%; }
>  #bezstthztt .gt_spanner_row { border-bottom-style: hidden; }
>  #bezstthztt .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; 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; }
>  #bezstthztt .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; }
>  #bezstthztt .gt_from_md> :first-child { margin-top: 0; }
>  #bezstthztt .gt_from_md> :last-child { margin-bottom: 0; }
>  #bezstthztt .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-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; overflow-x: hidden; }
>  #bezstthztt .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: 5px; padding-right: 5px; }
>  #bezstthztt .gt_indent_1 { text-indent: 5px; }
>  #bezstthztt .gt_indent_2 { text-indent: calc(5px * 2); }
>  #bezstthztt .gt_indent_3 { text-indent: calc(5px * 3); }
>  #bezstthztt .gt_indent_4 { text-indent: calc(5px * 4); }
>  #bezstthztt .gt_indent_5 { text-indent: calc(5px * 5); }
>  #bezstthztt .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: 5px; padding-right: 5px; vertical-align: top; }
>  #bezstthztt .gt_row_group_first td { border-top-width: 2px; }
>  #bezstthztt .gt_row_group_first th { border-top-width: 2px; }
>  #bezstthztt .gt_striped { color: #333333; background-color: #F4F4F4; }
>  #bezstthztt .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; }
>  #bezstthztt .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
>  #bezstthztt .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
>  #bezstthztt .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
>  #bezstthztt .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
>  #bezstthztt .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
>  #bezstthztt .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
>  #bezstthztt .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; }
>  #bezstthztt .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
>  #bezstthztt .gt_left { text-align: left; }
>  #bezstthztt .gt_center { text-align: center; }
>  #bezstthztt .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
>  #bezstthztt .gt_font_normal { font-weight: normal; }
>  #bezstthztt .gt_font_bold { font-weight: bold; }
>  #bezstthztt .gt_font_italic { font-style: italic; }
>  #bezstthztt .gt_super { font-size: 65%; }
>  #bezstthztt .gt_footnotes { color: font-color(#FFFFFF); 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; }
>  #bezstthztt .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
>  #bezstthztt .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; }
>  #bezstthztt .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
>  #bezstthztt .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
>  #bezstthztt .gt_asterisk { font-size: 100%; vertical-align: 0; }
>  
> </style>
>
> | name | lines | case4 |
> |----|----|----|
> | Argentine | 1 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /></span> |
> | Bastille | 1, 5, 8 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_5.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_8.svg" style="height: 2em;vertical-align: middle;" /></span> |
> | Bérault | 1 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /></span> |
> | Champs-Élysées--Clemenceau | 1, 13 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_13.svg" style="height: 2em;vertical-align: middle;" /></span> |
> | Charles de Gaulle--Étoile | 1, 2, 6 | <span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_2.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_6.svg" style="height: 2em;vertical-align: middle;" /></span> |
>
> </div>
>
> </div>
>
> </div>
>
> > **Warning: 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:
> >
> > <div id="6d968065" class="cell" data-execution_count="14">
> >
> > ``` python
> > file_pattern = str(img_local_paths / "metro_{}.svg")
> > (
> >     GT(metro_mini4)
> >     .fmt_image("case4", file_pattern=file_pattern)
> >     .cols_align(align="right", columns="case4")
> > )
> > ```
> >
> > <div class="cell-output cell-output-display" data-execution_count="13">
> >
> > <div id="kaprxqfhiz" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
> >
> > <style>
> > #kaprxqfhiz table {
> >           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;
> >         }
> >
> > #kaprxqfhiz thead, tbody, tfoot, tr, td, th { border-style: none; }
> >  tr { background-color: transparent; }
> > #kaprxqfhiz p { margin: 0; padding: 0; }
> >  #kaprxqfhiz .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; }
> >  #kaprxqfhiz .gt_caption { padding-top: 4px; padding-bottom: 4px; }
> >  #kaprxqfhiz .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
> >  #kaprxqfhiz .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
> >  #kaprxqfhiz .gt_heading { background-color: #FFFFFF; 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; }
> >  #kaprxqfhiz .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
> >  #kaprxqfhiz .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; }
> >  #kaprxqfhiz .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: 5px; padding-right: 5px; overflow-x: hidden; }
> >  #kaprxqfhiz .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; }
> >  #kaprxqfhiz .gt_column_spanner_outer:first-child { padding-left: 0; }
> >  #kaprxqfhiz .gt_column_spanner_outer:last-child { padding-right: 0; }
> >  #kaprxqfhiz .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%; }
> >  #kaprxqfhiz .gt_spanner_row { border-bottom-style: hidden; }
> >  #kaprxqfhiz .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; 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; }
> >  #kaprxqfhiz .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; }
> >  #kaprxqfhiz .gt_from_md> :first-child { margin-top: 0; }
> >  #kaprxqfhiz .gt_from_md> :last-child { margin-bottom: 0; }
> >  #kaprxqfhiz .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: solid; border-top-width: 1px; border-top-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; overflow-x: hidden; }
> >  #kaprxqfhiz .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: 5px; padding-right: 5px; }
> >  #kaprxqfhiz .gt_indent_1 { text-indent: 5px; }
> >  #kaprxqfhiz .gt_indent_2 { text-indent: calc(5px * 2); }
> >  #kaprxqfhiz .gt_indent_3 { text-indent: calc(5px * 3); }
> >  #kaprxqfhiz .gt_indent_4 { text-indent: calc(5px * 4); }
> >  #kaprxqfhiz .gt_indent_5 { text-indent: calc(5px * 5); }
> >  #kaprxqfhiz .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: 5px; padding-right: 5px; vertical-align: top; }
> >  #kaprxqfhiz .gt_row_group_first td { border-top-width: 2px; }
> >  #kaprxqfhiz .gt_row_group_first th { border-top-width: 2px; }
> >  #kaprxqfhiz .gt_striped { color: #333333; background-color: #F4F4F4; }
> >  #kaprxqfhiz .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; }
> >  #kaprxqfhiz .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
> >  #kaprxqfhiz .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
> >  #kaprxqfhiz .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
> >  #kaprxqfhiz .gt_grand_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
> >  #kaprxqfhiz .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
> >  #kaprxqfhiz .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
> >  #kaprxqfhiz .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; }
> >  #kaprxqfhiz .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
> >  #kaprxqfhiz .gt_left { text-align: left; }
> >  #kaprxqfhiz .gt_center { text-align: center; }
> >  #kaprxqfhiz .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
> >  #kaprxqfhiz .gt_font_normal { font-weight: normal; }
> >  #kaprxqfhiz .gt_font_bold { font-weight: bold; }
> >  #kaprxqfhiz .gt_font_italic { font-style: italic; }
> >  #kaprxqfhiz .gt_super { font-size: 65%; }
> >  #kaprxqfhiz .gt_footnotes { color: font-color(#FFFFFF); 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; }
> >  #kaprxqfhiz .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
> >  #kaprxqfhiz .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; }
> >  #kaprxqfhiz .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
> >  #kaprxqfhiz .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
> >  #kaprxqfhiz .gt_asterisk { font-size: 100%; vertical-align: 0; }
> >  
> > </style>
> >
> > | name | lines | case4 |
> > |----|----|----|
> > | Argentine | 1 | <span style="white-space:nowrap;"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDE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ny41MjctNjIuMjg2IDQzLjUyOS4wMSA2Ny41OCAyOS45MSA2Ny41OCA2Ni43OWwuMDA3LS4wMDR6bTguMjIgMjU0LjQyYzAgNDIuMDQyLTI3Ljc3IDc3LjM3My03OC4wOTUgNzcuMzczLTUxLjEwMyAwLTc5LjU1LTQxLjQ1OS03OS41NS04NC44OTYgMC00MS4xODggMzQuNTM5LTc1LjcwNSA2OS4wNTgtODkuMzE4IDQ0Ljk5IDIyLjU0IDg4LjU5IDQ4LjggODguNTkgOTYuODVsLS4wMDMtLjAwOXoiLz48L3N2Zz4=" style="height: 2em;vertical-align: middle;" /></span> |
> > | Bérault | 1 | <span style="white-space:nowrap;"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDEwNTAgMTA1MCIgc3R5bGU9ImhlaWdodDoxZW07d2lkdGg6MS4xM2VtO3ZlcnRpY2FsLWFsaWduOi0wLjEyNWVtO21hcmdpbi1sZWZ0OmF1dG87bWFyZ2luLXJpZ2h0OmF1dG87Zm9udC1zaXplOmluaGVyaXQ7b3ZlcmZsb3c6dmlzaWJsZTtwb3NpdGlvbjpyZWxhdGl2ZTsiPjxjaXJjbGUgZmlsbD0iI0ZFQ0UwMCIgY3g9IjUwMCIgY3k9IjUwMCIgcj0iNTAwIi8+PHBhdGggZmlsbD0iIzIyMUUyMCIgZD0iTTU3Ny4wMjYgNzYzLjk4N1YyMzQuMDIyaC05Mi4zNTJjLTIzLjkzOCAxOC43MTQtODEuMDE3IDU0LjAyNi0xNDIuNTY1IDgzLjI2NWwtMzIuMjg3IDE1LjE0NyAzNi4wMTQgODEuMDQyIDI3Ljk0Ni0xNC4zOGMxOS4zNzgtOS42MTEgNzIuNjE3LTM3LjM1NyA5MC42OC01MS43djQxNi41OTFoMTEyLjU2NCIvPjwvc3ZnPg==" style="height: 2em;vertical-align: middle;" /></span> |
> > | Champs-Élysées--Clemenceau | 1, 13 | <span style="white-space:nowrap;"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDEwNTAgMTA1MCIgc3R5bGU9ImhlaWdodDoxZW07d2lkdGg6MS4xM2VtO3ZlcnRpY2FsLWFsaWduOi0wLjEyNWVtO21hcmdpbi1sZWZ0OmF1dG87bWFyZ2luLXJpZ2h0OmF1dG87Zm9udC1zaXplOmluaGVyaXQ7b3ZlcmZsb3c6dmlzaWJsZTtwb3NpdGlvbjpyZWxhdGl2ZTsiPjxjaXJjbGUgZmlsbD0iI0ZFQ0UwMCIgY3g9IjUwMCIgY3k9IjUwMCIgcj0iNTAwIi8+PHBhdGggZmlsbD0iIzIyMUUyMCIgZD0iTTU3Ny4wMjYgNzYzLjk4N1YyMzQuMDIyaC05Mi4zNTJjLTIzLjkzOCAxOC43MTQtODEuMDE3IDU0LjAyNi0xNDIuNTY1IDgzLjI2NWwtMzIuMjg3IDE1LjE0NyAzNi4wMTQgODEuMDQyIDI3Ljk0Ni0xNC4zOGMxOS4zNzgtOS42MTEgNzIuNjE3LTM3LjM1NyA5MC42OC01MS43djQxNi41OTFoMTEyLjU2NCIvPjwvc3ZnPg==" style="height: 2em;vertical-align: middle;" /> <img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDEwNTAgMTA1MCIgc3R5bGU9ImhlaWdodDoxZW07d2lkdGg6MS4xM2VtO3ZlcnRpY2FsLWFsaWduOi0wLjEyNWVtO21hcmdpbi1sZWZ0OmF1dG87bWFyZ2luLXJpZ2h0OmF1dG87Zm9udC1zaXplOmluaGVyaXQ7b3ZlcmZsb3c6dmlzaWJsZTtwb3NpdGlvbjpyZWxhdGl2ZTsiPjxjaXJjbGUgZmlsbD0iIzk5RDRERSIgY3g9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gaulle--Étoile | 1, 2, 6 | <span style="white-space:nowrap;"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDEwNTAgMTA1MCIgc3R5bGU9ImhlaWdodDoxZW07d2lkdGg6MS4xM2VtO3ZlcnRpY2FsLWFsaWduOi0wLjEyNWVtO21hcmdpbi1sZWZ0OmF1dG87bWFyZ2luLXJpZ2h0OmF1dG87Zm9udC1zaXplOmluaGVyaXQ7b3ZlcmZsb3c6dmlzaWJsZTtwb3NpdGlvbjpyZWxhdGl2ZTsiPjxjaXJjbGUgZmlsbD0iI0ZFQ0UwMCIgY3g9IjUwMCIgY3k9IjUwMCIgcj0iNTAwIi8+PHBhdGggZmlsbD0iIzIyMUUyMCIgZD0iTTU3Ny4wMjYgNzYzLjk4N1YyMzQuMDIyaC05Mi4zNTJjLTIzLjkzOCAxOC43MTQtODEuMDE3IDU0LjAyNi0xNDIuNTY1IDgzLjI2NWwtMzIuMjg3IDE1LjE0NyAzNi4wMTQgODEuMDQyIDI3Ljk0Ni0xNC4zOGMxOS4zNzgtOS42MTEgNzIuNjE3LTM3LjM1NyA5MC42OC01MS43djQxNi41OTFoMTEyLjU2NCIvPjwvc3ZnPg==" style="height: 2em;vertical-align: middle;" /> <img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDEwNTAgMTA1MCIgc3R5bGU9ImhlaWdodDoxZW07d2lkdGg6MS4xM2VtO3ZlcnRpY2FsLWFsaWduOi0wLjEyNWVtO21hcmdpbi1sZWZ0OmF1dG87bWFyZ2luLXJpZ2h0OmF1dG87Zm9udC1zaXplOmluaGVyaXQ7b3ZlcmZsb3c6dmlzaWJsZTtwb3NpdGlvbjpyZWxhdGl2ZTsiPjxjaXJjbGUgZmlsbD0iIzAwNjVBRS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Ny4wMS0xNTcuMTEtMTU3LjAxLTU1Ljk0NyAwLTg5Ljg4NyAyMC4yODctMTA3Ljc5IDM2LjA2OCA2LjY5OS0xMDYuNTIxIDYxLjQzOC0xNTkuODcgMTM0LjQxLTE1OS44NyAyOS43NjggMCA1Ni45NzMgNi43MDEgNzEuMDMxIDEyLjg5MWwxNi42Ni05MC4xMTVjLTIxLjcxMy01LjQxNy00OC45MTYtOC45MzQtNzguODMtOC45MzQtMTY2LjU5IDAtMjUxLjM2IDEyNS44OTEtMjUxLjM2IDMwOS44OTEgMCAxNDAuMzUgNTAuODk1IDI0MC4zMSAxOTMuNTggMjQwLjMxIDEwOC44OS0uMDAxIDE3OS40MS03Ny41NjEgMTc5LjQwOS0xODMuMjMxbS0xMDUuODA5IDExLjI4YzAgNDUuNjI1LTI2LjI1NCA4OC40My03Ny40MDEgODguNDMtNTIuNTc4IDAtODAuOTUzLTQ4Ljc3Mi04MC45NTMtOTkuMTIgMC0xNS42MzggMC0zNS45NTkgNi4wMDQtNDQuOTY4IDEwLjQ3MS0xNi41ODYgMzYuNzk3LTI5LjE4NCA2OS4wNTUtMjkuMTg0IDUwLjkyIDAgODMuMjkgMzUuMTkgODMuMjkgODQuODRsLjAwNS4wMDJ6Ii8+PC9zdmc+" style="height: 2em;vertical-align: middle;" /></span> |
> >
> > **Case 4** is undoubtedly one of the most powerful features of Great Tables. While mastering it may take some practice, we hope this example helps you render images effortlessly and effectively.
> >
> > <div id="rendering-images-anywhere" class="section level1">
> >
> > # Rendering Images Anywhere
> >
> > While [GT.fmt_image()](../../reference/GT.fmt_image.md#great_tables.GT.fmt_image) is primarily designed for rendering images in the table body, what if you need to display images in other locations, such as the header? In such cases, you can turn to the versatile [vals.fmt_image()](https://posit-dev.github.io/great-tables/reference/vals.fmt_image.html#great_tables.vals.fmt_image).
> >
> > [vals.fmt_image()](../../reference/vals.fmt_image.md#great_tables.vals.fmt_image) is a hidden gem in Great Tables. Its usage is similar to [GT.fmt_image()](../../reference/GT.fmt_image.md#great_tables.GT.fmt_image), but instead of working directly with DataFrame columns, it lets you pass a string or a list of strings as the first argument, returning a list of strings, each representing an image. You can then wrap these strings with [html()](https://posit-dev.github.io/great-tables/reference/html.html#great_tables.html), allowing Great Tables to render the images anywhere in the table.
> >
> > <div id="preparations-1" class="section level2">
> >
> > ## Preparations
> >
> > We will create a `Pandas` DataFrame named `metro_mini` using the `data` dictionary. This will be used for demonstration in the following examples:
> >
> > <div id="37dc9c33" class="cell" data-execution_count="15">
> >
> > Show the Code
> >
> > ``` python
> > metro_mini = pd.DataFrame(data)
> > metro_mini
> > ```
> >
> > <div class="cell-output cell-output-display" data-execution_count="14">
> >
> > <div>
> >
> > |     | name                      | lines   |
> > |-----|---------------------------|---------|
> > | 0   | Argentine                 | 1       |
> > | 1   | Bastille                  | 1, 5, 8 |
> > | 2   | Bérault                   | 1       |
> > | 3   | Champs-Élysées--Clemenceau | 1, 13   |
> > | 4   | Charles de Gaulle--Étoile  | 1, 2, 6 |
> >
> > </div>
> >
> > </div>
> >
> > </div>
> >
> > <div id="single-image" class="section level2">
> >
> > ## Single Image
> >
> > This example shows how to render a valid URL as an image in the title of the table header:
> >
> > <div id="ee85c576" class="cell" data-execution_count="16">
> >
> > ``` python
> > 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)
> > gt_logo = html(_gt_logo)
> >
> > (
> >     GT(metro_mini)
> >     .fmt_image("lines", path=img_url_paths, file_pattern="metro_{}.svg")
> >     .tab_header(title=gt_logo)
> >     .cols_align(align="right", columns="lines")
> >     .opt_stylize(style=4, color="gray")
> > )
> > ```
> >
> > <div class="cell-annotation">
> >
> > 1  
> > <span data-code-cell="annotated-cell-14" data-code-lines="3" data-code-annotation="1">[vals.fmt_image()](../../reference/vals.fmt_image.md#great_tables.vals.fmt_image) returns a list of strings. Here, we use tuple unpacking to extract the first item from the list.</span>
> >
> > </div>
> >
> > <div class="cell-output cell-output-display" data-execution_count="15">
> >
> > <div id="wrwjfsbiyy" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
> >
> > <style>
> > #wrwjfsbiyy table {
> >           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;
> >         }
> >
> > #wrwjfsbiyy thead, tbody, tfoot, tr, td, th { border-style: none; }
> >  tr { background-color: transparent; }
> > #wrwjfsbiyy p { margin: 0; padding: 0; }
> >  #wrwjfsbiyy .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: 3px; border-top-color: #D5D5D5; border-right-style: solid; border-right-width: 3px; border-right-color: #D5D5D5; border-bottom-style: solid; border-bottom-width: 3px; border-bottom-color: #D5D5D5; border-left-style: solid; border-left-width: 3px; border-left-color: #D5D5D5; }
> >  #wrwjfsbiyy .gt_caption { padding-top: 4px; padding-bottom: 4px; }
> >  #wrwjfsbiyy .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
> >  #wrwjfsbiyy .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
> >  #wrwjfsbiyy .gt_heading { background-color: #FFFFFF; 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; }
> >  #wrwjfsbiyy .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D5D5D5; }
> >  #wrwjfsbiyy .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D5D5D5; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D5D5D5; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
> >  #wrwjfsbiyy .gt_col_heading { color: #FFFFFF; background-color: #5F5F5F; 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: 5px; padding-right: 5px; overflow-x: hidden; }
> >  #wrwjfsbiyy .gt_column_spanner_outer { color: #FFFFFF; background-color: #5F5F5F; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
> >  #wrwjfsbiyy .gt_column_spanner_outer:first-child { padding-left: 0; }
> >  #wrwjfsbiyy .gt_column_spanner_outer:last-child { padding-right: 0; }
> >  #wrwjfsbiyy .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D5D5D5; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
> >  #wrwjfsbiyy .gt_spanner_row { border-bottom-style: hidden; }
> >  #wrwjfsbiyy .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; 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: #D5D5D5; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D5D5D5; 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; }
> >  #wrwjfsbiyy .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: #D5D5D5; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D5D5D5; vertical-align: middle; }
> >  #wrwjfsbiyy .gt_from_md> :first-child { margin-top: 0; }
> >  #wrwjfsbiyy .gt_from_md> :last-child { margin-bottom: 0; }
> >  #wrwjfsbiyy .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: dashed; border-top-width: 1px; border-top-color: #D5D5D5; border-left-style: dashed; border-left-width: 1px; border-left-color: #D5D5D5; border-right-style: dashed; border-right-width: 1px; border-right-color: #D5D5D5; vertical-align: middle; overflow-x: hidden; }
> >  #wrwjfsbiyy .gt_stub { color: #333333; background-color: #929292; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: dashed; border-right-width: 2px; border-right-color: #D5D5D5; padding-left: 5px; padding-right: 5px; }
> >  #wrwjfsbiyy .gt_indent_1 { text-indent: 5px; }
> >  #wrwjfsbiyy .gt_indent_2 { text-indent: calc(5px * 2); }
> >  #wrwjfsbiyy .gt_indent_3 { text-indent: calc(5px * 3); }
> >  #wrwjfsbiyy .gt_indent_4 { text-indent: calc(5px * 4); }
> >  #wrwjfsbiyy .gt_indent_5 { text-indent: calc(5px * 5); }
> >  #wrwjfsbiyy .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: 5px; padding-right: 5px; vertical-align: top; }
> >  #wrwjfsbiyy .gt_row_group_first td { border-top-width: 2px; }
> >  #wrwjfsbiyy .gt_row_group_first th { border-top-width: 2px; }
> >  #wrwjfsbiyy .gt_striped { color: #333333; background-color: #F4F4F4; }
> >  #wrwjfsbiyy .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D5D5D5; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D5D5D5; }
> >  #wrwjfsbiyy .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
> >  #wrwjfsbiyy .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
> >  #wrwjfsbiyy .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
> >  #wrwjfsbiyy .gt_grand_summary_row { color: #FFFFFF; background-color: #5F5F5F; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
> >  #wrwjfsbiyy .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
> >  #wrwjfsbiyy .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
> >  #wrwjfsbiyy .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; }
> >  #wrwjfsbiyy .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
> >  #wrwjfsbiyy .gt_left { text-align: left; }
> >  #wrwjfsbiyy .gt_center { text-align: center; }
> >  #wrwjfsbiyy .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
> >  #wrwjfsbiyy .gt_font_normal { font-weight: normal; }
> >  #wrwjfsbiyy .gt_font_bold { font-weight: bold; }
> >  #wrwjfsbiyy .gt_font_italic { font-style: italic; }
> >  #wrwjfsbiyy .gt_super { font-size: 65%; }
> >  #wrwjfsbiyy .gt_footnotes { color: font-color(#FFFFFF); 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; }
> >  #wrwjfsbiyy .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
> >  #wrwjfsbiyy .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; }
> >  #wrwjfsbiyy .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
> >  #wrwjfsbiyy .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
> >  #wrwjfsbiyy .gt_asterisk { font-size: 100%; vertical-align: 0; }
> >  
> > </style>
> >
> > <table class="gt_table" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
> > <thead>
> > <tr class="gt_heading">
> > <th colspan="2" class="gt_heading gt_title gt_font_normal"><span style="white-space:nowrap;"><img src="https://posit-dev.github.io/great-tables/assets/GT_logo.svg" style="height: 100px;vertical-align: middle;" /></span></th>
> > </tr>
> > <tr class="gt_col_headings">
> > <th id="name" class="gt_col_heading gt_columns_bottom_border gt_left" scope="col">name</th>
> > <th id="lines" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">lines</th>
> > </tr>
> > </thead>
> > <tbody class="gt_table_body">
> > <tr>
> > <td class="gt_row gt_left">Argentine</td>
> > <td class="gt_row gt_right"><span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /></span></td>
> > </tr>
> > <tr>
> > <td class="gt_row gt_left gt_striped">Bastille</td>
> > <td class="gt_row gt_right gt_striped"><span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_5.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_8.svg" style="height: 2em;vertical-align: middle;" /></span></td>
> > </tr>
> > <tr>
> > <td class="gt_row gt_left">Bérault</td>
> > <td class="gt_row gt_right"><span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /></span></td>
> > </tr>
> > <tr>
> > <td class="gt_row gt_left gt_striped">Champs-Élysées--Clemenceau</td>
> > <td class="gt_row gt_right gt_striped"><span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_13.svg" style="height: 2em;vertical-align: middle;" /></span></td>
> > </tr>
> > <tr>
> > <td class="gt_row gt_left">Charles de Gaulle--Étoile</td>
> > <td class="gt_row gt_right"><span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_2.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_6.svg" style="height: 2em;vertical-align: middle;" /></span></td>
> > </tr>
> > </tbody>
> > </table>
> >
> > </div>
> >
> > </div>
> >
> > </div>
> >
> > <div id="multiple-images" class="section level2">
> >
> > ## Multiple Images
> >
> > This example demonstrates how to render two valid URLs as images in the title and subtitle of the table header:
> >
> > <div id="015df659" class="cell" data-execution_count="17">
> >
> > ``` python
> > metro_logo_url = "https://raw.githubusercontent.com/rstudio/gt/master/images/dataset_metro.svg"
> > logo_urls = [gt_logo_url, metro_logo_url]
> >
> > 1_gt_logo, _metro_logo = vals.fmt_image(logo_urls, height=100)
> > gt_logo, metro_logo = html(_gt_logo), html(_metro_logo)
> >
> > (
> >     GT(metro_mini)
> >     .fmt_image("lines", path=img_url_paths, file_pattern="metro_{}.svg")
> >     .tab_header(title=gt_logo, subtitle=metro_logo)
> >     .cols_align(align="right", columns="lines")
> >     .opt_stylize(style=4, color="gray")
> > )
> > ```
> >
> > <div class="cell-annotation">
> >
> > 1  
> > <span data-code-cell="annotated-cell-15" data-code-lines="4" data-code-annotation="1">Note that if you need to render images with different `height` or `width`, you might need to make two separate calls to [vals.fmt_image()](../../reference/vals.fmt_image.md#great_tables.vals.fmt_image).</span>
> >
> > </div>
> >
> > <div class="cell-output cell-output-display" data-execution_count="16">
> >
> > <div id="bohiwxfvdc" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
> >
> > <style>
> > #bohiwxfvdc table {
> >           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;
> >         }
> >
> > #bohiwxfvdc thead, tbody, tfoot, tr, td, th { border-style: none; }
> >  tr { background-color: transparent; }
> > #bohiwxfvdc p { margin: 0; padding: 0; }
> >  #bohiwxfvdc .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: 3px; border-top-color: #D5D5D5; border-right-style: solid; border-right-width: 3px; border-right-color: #D5D5D5; border-bottom-style: solid; border-bottom-width: 3px; border-bottom-color: #D5D5D5; border-left-style: solid; border-left-width: 3px; border-left-color: #D5D5D5; }
> >  #bohiwxfvdc .gt_caption { padding-top: 4px; padding-bottom: 4px; }
> >  #bohiwxfvdc .gt_title { color: #333333; font-size: 125%; font-weight: initial; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; border-bottom-color: #FFFFFF; border-bottom-width: 0; }
> >  #bohiwxfvdc .gt_subtitle { color: #333333; font-size: 85%; font-weight: initial; padding-top: 3px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top-color: #FFFFFF; border-top-width: 0; }
> >  #bohiwxfvdc .gt_heading { background-color: #FFFFFF; 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; }
> >  #bohiwxfvdc .gt_bottom_border { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D5D5D5; }
> >  #bohiwxfvdc .gt_col_headings { border-top-style: solid; border-top-width: 2px; border-top-color: #D5D5D5; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D5D5D5; border-left-style: none; border-left-width: 1px; border-left-color: #D3D3D3; border-right-style: none; border-right-width: 1px; border-right-color: #D3D3D3; }
> >  #bohiwxfvdc .gt_col_heading { color: #FFFFFF; background-color: #5F5F5F; 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: 5px; padding-right: 5px; overflow-x: hidden; }
> >  #bohiwxfvdc .gt_column_spanner_outer { color: #FFFFFF; background-color: #5F5F5F; font-size: 100%; font-weight: normal; text-transform: inherit; padding-top: 0; padding-bottom: 0; padding-left: 4px; padding-right: 4px; }
> >  #bohiwxfvdc .gt_column_spanner_outer:first-child { padding-left: 0; }
> >  #bohiwxfvdc .gt_column_spanner_outer:last-child { padding-right: 0; }
> >  #bohiwxfvdc .gt_column_spanner { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D5D5D5; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; overflow-x: hidden; display: inline-block; width: 100%; }
> >  #bohiwxfvdc .gt_spanner_row { border-bottom-style: hidden; }
> >  #bohiwxfvdc .gt_group_heading { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; 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: #D5D5D5; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D5D5D5; 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; }
> >  #bohiwxfvdc .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: #D5D5D5; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D5D5D5; vertical-align: middle; }
> >  #bohiwxfvdc .gt_from_md> :first-child { margin-top: 0; }
> >  #bohiwxfvdc .gt_from_md> :last-child { margin-bottom: 0; }
> >  #bohiwxfvdc .gt_row { padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; margin: 10px; border-top-style: dashed; border-top-width: 1px; border-top-color: #D5D5D5; border-left-style: dashed; border-left-width: 1px; border-left-color: #D5D5D5; border-right-style: dashed; border-right-width: 1px; border-right-color: #D5D5D5; vertical-align: middle; overflow-x: hidden; }
> >  #bohiwxfvdc .gt_stub { color: #333333; background-color: #929292; font-size: 100%; font-weight: initial; text-transform: inherit; border-right-style: dashed; border-right-width: 2px; border-right-color: #D5D5D5; padding-left: 5px; padding-right: 5px; }
> >  #bohiwxfvdc .gt_indent_1 { text-indent: 5px; }
> >  #bohiwxfvdc .gt_indent_2 { text-indent: calc(5px * 2); }
> >  #bohiwxfvdc .gt_indent_3 { text-indent: calc(5px * 3); }
> >  #bohiwxfvdc .gt_indent_4 { text-indent: calc(5px * 4); }
> >  #bohiwxfvdc .gt_indent_5 { text-indent: calc(5px * 5); }
> >  #bohiwxfvdc .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: 5px; padding-right: 5px; vertical-align: top; }
> >  #bohiwxfvdc .gt_row_group_first td { border-top-width: 2px; }
> >  #bohiwxfvdc .gt_row_group_first th { border-top-width: 2px; }
> >  #bohiwxfvdc .gt_striped { color: #333333; background-color: #F4F4F4; }
> >  #bohiwxfvdc .gt_table_body { border-top-style: solid; border-top-width: 2px; border-top-color: #D5D5D5; border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D5D5D5; }
> >  #bohiwxfvdc .gt_summary_row { color: #333333; background-color: #FFFFFF; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
> >  #bohiwxfvdc .gt_first_summary_row { border-top-style: solid; border-top-width: 2px; border-top-color: #D3D3D3; }
> >  #bohiwxfvdc .gt_last_summary_row_top { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #D3D3D3; }
> >  #bohiwxfvdc .gt_grand_summary_row { color: #FFFFFF; background-color: #5F5F5F; text-transform: inherit; padding-top: 8px; padding-bottom: 8px; padding-left: 5px; padding-right: 5px; }
> >  #bohiwxfvdc .gt_first_grand_summary_row_bottom { border-top-style: double; border-top-width: 6px; border-top-color: #D3D3D3; }
> >  #bohiwxfvdc .gt_last_grand_summary_row_top { border-bottom-style: double; border-bottom-width: 6px; border-bottom-color: #D3D3D3; }
> >  #bohiwxfvdc .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; }
> >  #bohiwxfvdc .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
> >  #bohiwxfvdc .gt_left { text-align: left; }
> >  #bohiwxfvdc .gt_center { text-align: center; }
> >  #bohiwxfvdc .gt_right { text-align: right; font-variant-numeric: tabular-nums; }
> >  #bohiwxfvdc .gt_font_normal { font-weight: normal; }
> >  #bohiwxfvdc .gt_font_bold { font-weight: bold; }
> >  #bohiwxfvdc .gt_font_italic { font-style: italic; }
> >  #bohiwxfvdc .gt_super { font-size: 65%; }
> >  #bohiwxfvdc .gt_footnotes { color: font-color(#FFFFFF); 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; }
> >  #bohiwxfvdc .gt_footnote { margin: 0px; font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; }
> >  #bohiwxfvdc .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; }
> >  #bohiwxfvdc .gt_sourcenote { font-size: 90%; padding-top: 4px; padding-bottom: 4px; padding-left: 5px; padding-right: 5px; text-align: left; }
> >  #bohiwxfvdc .gt_footnote_marks { font-size: 75%; vertical-align: 0.4em; position: initial; }
> >  #bohiwxfvdc .gt_asterisk { font-size: 100%; vertical-align: 0; }
> >  
> > </style>
> >
> > <table class="gt_table" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
> > <thead>
> > <tr class="gt_heading">
> > <th colspan="2" class="gt_heading gt_title gt_font_normal"><span style="white-space:nowrap;"><img src="https://posit-dev.github.io/great-tables/assets/GT_logo.svg" style="height: 100px;vertical-align: middle;" /></span></th>
> > </tr>
> > <tr class="gt_heading">
> > <th colspan="2" class="gt_heading gt_subtitle gt_font_normal gt_bottom_border"><span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/rstudio/gt/master/images/dataset_metro.svg" style="height: 100px;vertical-align: middle;" /></span></th>
> > </tr>
> > <tr class="gt_col_headings">
> > <th id="name" class="gt_col_heading gt_columns_bottom_border gt_left" scope="col">name</th>
> > <th id="lines" class="gt_col_heading gt_columns_bottom_border gt_right" scope="col">lines</th>
> > </tr>
> > </thead>
> > <tbody class="gt_table_body">
> > <tr>
> > <td class="gt_row gt_left">Argentine</td>
> > <td class="gt_row gt_right"><span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /></span></td>
> > </tr>
> > <tr>
> > <td class="gt_row gt_left gt_striped">Bastille</td>
> > <td class="gt_row gt_right gt_striped"><span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_5.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_8.svg" style="height: 2em;vertical-align: middle;" /></span></td>
> > </tr>
> > <tr>
> > <td class="gt_row gt_left">Bérault</td>
> > <td class="gt_row gt_right"><span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /></span></td>
> > </tr>
> > <tr>
> > <td class="gt_row gt_left gt_striped">Champs-Élysées--Clemenceau</td>
> > <td class="gt_row gt_right gt_striped"><span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_13.svg" style="height: 2em;vertical-align: middle;" /></span></td>
> > </tr>
> > <tr>
> > <td class="gt_row gt_left">Charles de Gaulle--Étoile</td>
> > <td class="gt_row gt_right"><span style="white-space:nowrap;"><img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_1.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_2.svg" style="height: 2em;vertical-align: middle;" /> <img src="https://raw.githubusercontent.com/posit-dev/great-tables/refs/heads/main/great_tables/data/metro_images/metro_6.svg" style="height: 2em;vertical-align: middle;" /></span></td>
> > </tr>
> > </tbody>
> > </table>
> >
> > </div>
> >
> > </div>
> >
> > </div>
> >
> > <div id="manually-rendering-images-anywhere" class="section level1">
> >
> > # Manually Rendering Images Anywhere
> >
> > Remember, you can always use [html()](../../reference/html.md#great_tables.html) to manually construct your desired output. For example, the previous table can be created without relying on [vals.fmt_image()](../../reference/vals.fmt_image.md#great_tables.vals.fmt_image) like this:
> >
> > <div id="e509fce4" class="cell" data-execution_count="18">
> >
> > ``` python
> > (
> >     GT(metro_mini)
> >     .fmt_image("lines", path=img_url_paths, file_pattern="metro_{}.svg")
> >     .tab_header(
> >         title=html(f'<img src="{gt_logo_url}" height="100">'),
> >         subtitle=html(f'<img src="{metro_logo_url}" height="100">'),
> >     )
> >     .cols_align(align="right", columns="lines")
> >     .opt_stylize(style=4, color="gray")
> > )
> > ```
> >
> > </div>
> >
> > Alternatively, you can manually encode the image using Python's built-in [base64](https://docs.python.org/3/library/base64.html) module, specify the appropriate MIME type and HTML attributes, and then wrap it in [html()](../../reference/html.md#great_tables.html) to display the table.
> >
> > <div id="final-words" class="section level1">
> >
> > # Final Words
> >
> > In this post, we focused on the most common use cases for rendering images in Great Tables, deliberately avoiding excessive DataFrame operations. Including such details could have overwhelmed the post with examples of string manipulations and the complexities of working with various DataFrame libraries.
> >
> > We hope you found this guide helpful and enjoyed the structured approach. Until next time, happy table creation with Great Tables!
> >
> > > **Note: Appendix: Related PRs**
> > >
> > > If you're interested in the recent enhancements we've made to image rendering, be sure to check out [\#444](https://github.com/posit-dev/great-tables/pull/444), [\#451](https://github.com/posit-dev/great-tables/pull/451) and [\#520](https://github.com/posit-dev/great-tables/pull/520) for all the details.
> >
> > </div>
> >
> > </div>
> >
> > </div>
> >
> > </div>
> >
> > </div>
> >
> > </div>
> >
> > </div>
> >
> > </div>
> >
> > </div>
>
> </div>
>
> </div>
>
> </div>
>
> </div>
