---------------------------------------------------------------------- This is the API documentation for the gdtest_gt_tables library. ---------------------------------------------------------------------- ## Functions Public functions make_gt_table() Create a sample Great Tables table. Returns ------- GT A styled GT table object. Examples -------- ```{python} from gdtest_gt_tables import make_gt_table make_gt_table() ``` summarize(data: list) -> dict Summarize a list of numbers. Parameters ---------- data List of numeric values. Returns ------- dict Summary statistics with keys ``mean``, ``total``, ``count``. ---------------------------------------------------------------------- This is the User Guide documentation for the package. ---------------------------------------------------------------------- ## A GT Table with Fixed Column Widths This page renders a Great Tables table with explicit column widths, which produces a `` element that must be preserved. ```{python} #| echo: false from great_tables import GT import pandas as pd df = pd.DataFrame({ "Name": ["Alice", "Bob", "Charlie", "Diana"], "Score": [95, 87, 92, 78], "Grade": ["A", "B+", "A-", "C+"], "Status": ["Pass", "Pass", "Pass", "Pass"], }) ( GT(df, id='gt_fixed') .tab_header(title="Student Grades", subtitle="Fall 2025") .cols_width(Name="150px", Score="80px", Grade="80px", Status="80px") .tab_options(quarto_disable_processing=True) ) ``` ## A GT Table without Fixed Widths This table uses default column sizing (no colgroup). ```{python} #| echo: false from great_tables import GT import pandas as pd df2 = pd.DataFrame({ "Feature": ["Responsive", "Dark mode", "Scroll"], "Supported": ["Yes", "Yes", "Yes"], }) GT(df2, id='gt_auto').tab_options(quarto_disable_processing=True) ``` ## A Standard Markdown Table This page has a conventional Markdown table that should get responsive wrapping and Bootstrap table styling. | Name | Score | Grade | Status | |---------|-------|-------|--------| | Alice | 95 | A | Pass | | Bob | 87 | B+ | Pass | | Charlie | 92 | A- | Pass | | Diana | 78 | C+ | Pass | The table above should: - Be wrapped in a `gd-table-responsive` div - NOT have a `` element - Receive Bootstrap `.table-bordered` styling ## A Second Table | Feature | Supported | |-------------|-----------| | Responsive | Yes | | Dark mode | Yes | | Scroll | Yes | ## GT Table (page-level `html-table-processing: none`) This page uses the YAML frontmatter option `html-table-processing: none` to disable Quarto's table processing at the page level, rather than per-table with `tab_options(quarto_disable_processing=True)`. ```{python} #| echo: false from great_tables import GT import pandas as pd df = pd.DataFrame({ "City": ["London", "Paris", "Tokyo", "Sydney"], "Population": [8_982_000, 2_161_000, 13_960_000, 5_312_000], "Area_km2": [1_572, 105, 2_194, 12_368], }) ( GT(df, id='gt_page_level') .tab_header(title="World Cities", subtitle="Population & Area") .cols_width(City="120px", Population="120px", Area_km2="100px") ) ``` ## Markdown Table on the Same Page This Markdown table is also on the page with `html-table-processing: none`, so it should also be free of Quarto's Bootstrap table classes. | City | Country | |---------|-----------| | London | UK | | Paris | France | | Tokyo | Japan |