Less ugly tables

These all look fine in html, most things do. But the word doc is where things seem to fall down. Especially if they have lots of text.

head(iris) |> 
  knitr::kable()
Table 1: This is a table with kable
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
5.1 3.5 1.4 0.2 setosa
4.9 3.0 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5.0 3.6 1.4 0.2 setosa
5.4 3.9 1.7 0.4 setosa
Table 2: This is a table with kableExtra. It does not render to word. It used to with prefer-html: true, but that workarounds seems not to work anymore.
# head(iris) |> 
#   knitr::kable() |> 
#   kableExtra::kable_styling()
head(iris) |> 
  huxtable::huxtable() |> 
  huxtable::theme_article()
Table 3: This is a table with huxtable
Sepal.LengthSepal.WidthPetal.LengthPetal.WidthSpecies
5.13.51.40.2setosa
4.93  1.40.2setosa
4.73.21.30.2setosa
4.63.11.50.2setosa
5  3.61.40.2setosa
5.43.91.70.4setosa
head(iris) |> 
 gt::gt()
Table 4: This is a table with gt
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
5.1 3.5 1.4 0.2 setosa
4.9 3.0 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5.0 3.6 1.4 0.2 setosa
5.4 3.9 1.7 0.4 setosa

Long text

This table is giving me fits elsewhere, let’s try it here. It has a common issue of

Table 5: This is just printed
texttab <- readr::read_csv('data/component_table.csv', show_col_types = FALSE)

texttab
# A tibble: 6 × 4
  `General HydroBOT components` General component defin…¹ Specific components …²
  <chr>                         <chr>                     <chr>                 
1 Input data                    Hydrologic data (timeser… Modified historical h…
2 Controller                    Interface between input … Sets up links to data…
3 Response models               A model of the response … EWR tool              
4 Aggregator                    Aggregates response mode… Response model sets t…
5 Comparer                      Compares scenarios (typi… Comparison of environ…
6 Causal networks               Describe causal relation… Long Term Water Plan …
# ℹ abbreviated names: ¹​`General component definitions`,
#   ²​`Specific components used in our example`
# ℹ 1 more variable: `Details of Specific components` <chr>
texttab |> 
  knitr::kable()
Table 6: This is a table with kable
General HydroBOT components General component definitions Specific components used in our example Details of Specific components
Input data Hydrologic data (timeseries). Typically representing multiple scenarios, e.g. climate and climate adaptations. May include other inputs as needed by response models.  Modified historical hydrographs to represent hypothetical climate change and adaptations (45 gauges, 15 scenarios) Daily flow rates for 45 for 15 scenarios
Controller Interface between input data, response model, and other toolkit components. Sets up run(s). Sets up links to data and parameters for EWR tool and aggregations. NA
Response models A model of the response of values, e.g. social, cultural, environmental, or economic values in response to hydrologic drivers. EWR tool The EWR tool holds databases of the EWRs required to meet the environmental objectives of the basin, which protect or enhance environmental assets that are valued based on ecological significance.
Aggregator Aggregates response model results to scales across the dimensions of time, space, and theme.  Response model sets the base scale for aggregation. EWR tool assesses hydrologic indicators (value) at gauges (space) and year (time). The spatial dimension consists of gauges nested within planning units within the basin. The time dimension assessess EWR performance averaged over the yearly data returned by the EWR tool. The value dimension consists of multiple EWRs (hydrologic indicators) that apply to environmental values (many-to-many), at multiple levels in the causal network (e.g. life-cycle components, species, groups of species, or long-term planning targets).
Comparer Compares scenarios (typically) or other groupings. Provides standard outputs including comparison methods, plots, and tables. Comparison of environmental values at various theme scales for the example climate and adaptation scenarios Explored in detail in figures and tables
Causal networks Describe causal relationships between values. Long Term Water Plan (LTWP) Provided by HydroBOT. LTWP required of Basin States by the Murray-Darling Basin Plan and give effect to the Basin-wide Environmental Watering Strategy. 
texttab |> 
  huxtable::huxtable() |> 
  huxtable::theme_article()
Table 7: This is a table with huxtable
General HydroBOT componentsGeneral component definitionsSpecific components used in our exampleDetails of Specific components
Input dataHydrologic data (timeseries). Typically representing multiple scenarios, e.g. climate and climate adaptations. May include other inputs as needed by response models. Modified historical hydrographs to represent hypothetical climate change and adaptations (45 gauges, 15 scenarios)Daily flow rates for 45 for 15 scenarios
ControllerInterface between input data, response model, and other toolkit components. Sets up run(s).Sets up links to data and parameters for EWR tool and aggregations.
Response modelsA model of the response of values, e.g. social, cultural, environmental, or economic values in response to hydrologic drivers.EWR toolThe EWR tool holds databases of the EWRs required to meet the environmental objectives of the basin, which protect or enhance environmental assets that are valued based on ecological significance.
AggregatorAggregates response model results to scales across the dimensions of time, space, and theme. Response model sets the base scale for aggregation. EWR tool assesses hydrologic indicators (value) at gauges (space) and year (time).The spatial dimension consists of gauges nested within planning units within the basin. The time dimension assessess EWR performance averaged over the yearly data returned by the EWR tool. The value dimension consists of multiple EWRs (hydrologic indicators) that apply to environmental values (many-to-many), at multiple levels in the causal network (e.g. life-cycle components, species, groups of species, or long-term planning targets).
ComparerCompares scenarios (typically) or other groupings. Provides standard outputs including comparison methods, plots, and tables.Comparison of environmental values at various theme scales for the example climate and adaptation scenariosExplored in detail in figures and tables
Causal networksDescribe causal relationships between values.Long Term Water Plan (LTWP)Provided by HydroBOT. LTWP required of Basin States by the Murray-Darling Basin Plan and give effect to the Basin-wide Environmental Watering Strategy. 
texttab |> 
 gt::gt()
Table 8: This is a table with gt
General HydroBOT components General component definitions Specific components used in our example Details of Specific components
Input data Hydrologic data (timeseries). Typically representing multiple scenarios, e.g. climate and climate adaptations. May include other inputs as needed by response models.  Modified historical hydrographs to represent hypothetical climate change and adaptations (45 gauges, 15 scenarios) Daily flow rates for 45 for 15 scenarios
Controller Interface between input data, response model, and other toolkit components. Sets up run(s). Sets up links to data and parameters for EWR tool and aggregations. NA
Response models A model of the response of values, e.g. social, cultural, environmental, or economic values in response to hydrologic drivers. EWR tool The EWR tool holds databases of the EWRs required to meet the environmental objectives of the basin, which protect or enhance environmental assets that are valued based on ecological significance.
Aggregator Aggregates response model results to scales across the dimensions of time, space, and theme.  Response model sets the base scale for aggregation. EWR tool assesses hydrologic indicators (value) at gauges (space) and year (time). The spatial dimension consists of gauges nested within planning units within the basin. The time dimension assessess EWR performance averaged over the yearly data returned by the EWR tool. The value dimension consists of multiple EWRs (hydrologic indicators) that apply to environmental values (many-to-many), at multiple levels in the causal network (e.g. life-cycle components, species, groups of species, or long-term planning targets).
Comparer Compares scenarios (typically) or other groupings. Provides standard outputs including comparison methods, plots, and tables. Comparison of environmental values at various theme scales for the example climate and adaptation scenarios Explored in detail in figures and tables
Causal networks Describe causal relationships between values. Long Term Water Plan (LTWP) Provided by HydroBOT. LTWP required of Basin States by the Murray-Darling Basin Plan and give effect to the Basin-wide Environmental Watering Strategy. 

gt seems to really have a lot of issues here. What if I use divs?

Table 9: This is a table with gt in a div.
texttab |> 
 gt::gt()
General HydroBOT components General component definitions Specific components used in our example Details of Specific components
Input data Hydrologic data (timeseries). Typically representing multiple scenarios, e.g. climate and climate adaptations. May include other inputs as needed by response models.  Modified historical hydrographs to represent hypothetical climate change and adaptations (45 gauges, 15 scenarios) Daily flow rates for 45 for 15 scenarios
Controller Interface between input data, response model, and other toolkit components. Sets up run(s). Sets up links to data and parameters for EWR tool and aggregations. NA
Response models A model of the response of values, e.g. social, cultural, environmental, or economic values in response to hydrologic drivers. EWR tool The EWR tool holds databases of the EWRs required to meet the environmental objectives of the basin, which protect or enhance environmental assets that are valued based on ecological significance.
Aggregator Aggregates response model results to scales across the dimensions of time, space, and theme.  Response model sets the base scale for aggregation. EWR tool assesses hydrologic indicators (value) at gauges (space) and year (time). The spatial dimension consists of gauges nested within planning units within the basin. The time dimension assessess EWR performance averaged over the yearly data returned by the EWR tool. The value dimension consists of multiple EWRs (hydrologic indicators) that apply to environmental values (many-to-many), at multiple levels in the causal network (e.g. life-cycle components, species, groups of species, or long-term planning targets).
Comparer Compares scenarios (typically) or other groupings. Provides standard outputs including comparison methods, plots, and tables. Comparison of environmental values at various theme scales for the example climate and adaptation scenarios Explored in detail in figures and tables
Causal networks Describe causal relationships between values. Long Term Water Plan (LTWP) Provided by HydroBOT. LTWP required of Basin States by the Murray-Darling Basin Plan and give effect to the Basin-wide Environmental Watering Strategy. 

Column widths.

None of those handle column widths with long text. kable smashes the first col, huxtable and gt smash them all.

Based on some github issues, does it work if I just don’t use a label at all?

Gt no label

texttab |> 
 gt::gt()
General HydroBOT components General component definitions Specific components used in our example Details of Specific components
Input data Hydrologic data (timeseries). Typically representing multiple scenarios, e.g. climate and climate adaptations. May include other inputs as needed by response models.  Modified historical hydrographs to represent hypothetical climate change and adaptations (45 gauges, 15 scenarios) Daily flow rates for 45 for 15 scenarios
Controller Interface between input data, response model, and other toolkit components. Sets up run(s). Sets up links to data and parameters for EWR tool and aggregations. NA
Response models A model of the response of values, e.g. social, cultural, environmental, or economic values in response to hydrologic drivers. EWR tool The EWR tool holds databases of the EWRs required to meet the environmental objectives of the basin, which protect or enhance environmental assets that are valued based on ecological significance.
Aggregator Aggregates response model results to scales across the dimensions of time, space, and theme.  Response model sets the base scale for aggregation. EWR tool assesses hydrologic indicators (value) at gauges (space) and year (time). The spatial dimension consists of gauges nested within planning units within the basin. The time dimension assessess EWR performance averaged over the yearly data returned by the EWR tool. The value dimension consists of multiple EWRs (hydrologic indicators) that apply to environmental values (many-to-many), at multiple levels in the causal network (e.g. life-cycle components, species, groups of species, or long-term planning targets).
Comparer Compares scenarios (typically) or other groupings. Provides standard outputs including comparison methods, plots, and tables. Comparison of environmental values at various theme scales for the example climate and adaptation scenarios Explored in detail in figures and tables
Causal networks Describe causal relationships between values. Long Term Water Plan (LTWP) Provided by HydroBOT. LTWP required of Basin States by the Murray-Darling Basin Plan and give effect to the Basin-wide Environmental Watering Strategy. 

Huxtable no label

texttab |> 
  huxtable::huxtable() |> 
  huxtable::theme_article()
General HydroBOT componentsGeneral component definitionsSpecific components used in our exampleDetails of Specific components
Input dataHydrologic data (timeseries). Typically representing multiple scenarios, e.g. climate and climate adaptations. May include other inputs as needed by response models. Modified historical hydrographs to represent hypothetical climate change and adaptations (45 gauges, 15 scenarios)Daily flow rates for 45 for 15 scenarios
ControllerInterface between input data, response model, and other toolkit components. Sets up run(s).Sets up links to data and parameters for EWR tool and aggregations.
Response modelsA model of the response of values, e.g. social, cultural, environmental, or economic values in response to hydrologic drivers.EWR toolThe EWR tool holds databases of the EWRs required to meet the environmental objectives of the basin, which protect or enhance environmental assets that are valued based on ecological significance.
AggregatorAggregates response model results to scales across the dimensions of time, space, and theme. Response model sets the base scale for aggregation. EWR tool assesses hydrologic indicators (value) at gauges (space) and year (time).The spatial dimension consists of gauges nested within planning units within the basin. The time dimension assessess EWR performance averaged over the yearly data returned by the EWR tool. The value dimension consists of multiple EWRs (hydrologic indicators) that apply to environmental values (many-to-many), at multiple levels in the causal network (e.g. life-cycle components, species, groups of species, or long-term planning targets).
ComparerCompares scenarios (typically) or other groupings. Provides standard outputs including comparison methods, plots, and tables.Comparison of environmental values at various theme scales for the example climate and adaptation scenariosExplored in detail in figures and tables
Causal networksDescribe causal relationships between values.Long Term Water Plan (LTWP)Provided by HydroBOT. LTWP required of Basin States by the Murray-Darling Basin Plan and give effect to the Basin-wide Environmental Watering Strategy.