From e98dfd854861c91fc826e976d61dd608bb614ae2 Mon Sep 17 00:00:00 2001 From: cldougl Date: Mon, 1 Oct 2018 16:03:15 -0400 Subject: [PATCH 1/2] :100: add percent examples --- tests/dash/app_sizing.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/dash/app_sizing.py b/tests/dash/app_sizing.py index 8732b7538..5cf2e6879 100644 --- a/tests/dash/app_sizing.py +++ b/tests/dash/app_sizing.py @@ -77,6 +77,37 @@ def layout(): """ ), html_table(df, table_style={"width": "100%"}, base_column_style={}), + section_title("HTML Table - Column Widths defined by Percents"), + html.Div( + """ + The column widths can be definied by percents rather than pixels. + """ + ), + html_table( + df, + table_style={"width": "100%"}, + column_style={ + "Date": {"width": '30%'}, + "Election Polling Organization": {"width": '25%'}, + "Dem": {"width": '5%'}, + "Rep": {"width": '5%'}, + "Ind": {"width": '5%'}, + "Region": {"width": '30%'}, + }, + ), + section_title("HTML Table - Column Widths defined by Percents"), + html.Div( + """ + The width of one column (Region=50%) can be definied by percent. + """ + ), + html_table( + df, + table_style={"width": "100%"}, + column_style={ + "Region": {"width": '50%'}, + }, + ), section_title("HTML Table - Columns with min-width"), html.Div( "Here, the min-width for the first column is 130px, or about the width of this line: " @@ -250,6 +281,8 @@ def layout(): ), section_title("Dash Table - Padding"), # ... + section_title("Dash Table - Column Widths by Percent"), + # ... section_title("Dash Table - Underspecified Widths"), # ... section_title("Dash Table - Widths that are smaller than the content"), From 877dd7c10c03accb383c0413fc9b6f9a53672a78 Mon Sep 17 00:00:00 2001 From: cldougl Date: Mon, 1 Oct 2018 17:41:28 -0400 Subject: [PATCH 2/2] :memo: title/example clarification --- tests/dash/app_sizing.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/dash/app_sizing.py b/tests/dash/app_sizing.py index 5cf2e6879..b7ea16a88 100644 --- a/tests/dash/app_sizing.py +++ b/tests/dash/app_sizing.py @@ -77,7 +77,7 @@ def layout(): """ ), html_table(df, table_style={"width": "100%"}, base_column_style={}), - section_title("HTML Table - Column Widths defined by Percents"), + section_title("HTML Table - All Column Widths defined by Percent"), html.Div( """ The column widths can be definied by percents rather than pixels. @@ -95,7 +95,7 @@ def layout(): "Region": {"width": '30%'}, }, ), - section_title("HTML Table - Column Widths defined by Percents"), + section_title("HTML Table - Single Column Width Defined by Percent"), html.Div( """ The width of one column (Region=50%) can be definied by percent. @@ -281,7 +281,9 @@ def layout(): ), section_title("Dash Table - Padding"), # ... - section_title("Dash Table - Column Widths by Percent"), + section_title("Dash Table - All Column Widths by Percent"), + # ... + section_title("Dash Table - Single Column Width by Percent"), # ... section_title("Dash Table - Underspecified Widths"), # ...