Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality for multi-table sheets #3

Open
matt-dray opened this issue Aug 19, 2021 · 2 comments
Open

Add functionality for multi-table sheets #3

matt-dray opened this issue Aug 19, 2021 · 2 comments
Labels
accessibility Meeting the guidelines enhancement New feature or request priority: on ice Do much later, maybe never

Comments

@matt-dray
Copy link
Collaborator

matt-dray commented Aug 19, 2021

Consider a sheet with two tables. They should each have their own subtable title and be separated by one empty column.

Note that the guidance suggests you don't have more than one table per sheet, so this is low priority. not a dealbreaker: users will likely be able to create separate sheets, e.g. 'Table 1a' and 'Table 1b', in these instances.

@matt-dray matt-dray added the enhancement New feature or request label Aug 19, 2021
@matt-dray matt-dray added priority: on ice Do much later, maybe never accessibility Meeting the guidelines labels Feb 26, 2022
@matt-dray
Copy link
Collaborator Author

matt-dray commented Dec 27, 2023

I think the best way to do this—in the current form of {a11ytables}—is to provide a list of dataframes to the tables argument of create_a11ytable().

create_a11ytable(
  tab_titles c("cover", "contents", "notes", "tables", "tables"),
  sheet_types = c("cover", "contents", "notes", "tables", "tables"),
  sheet_titles c("Publication", "Contents", "Notes", "Table 1", "Table 2"),
  tables = list(table_1_df, list(table_2a_df, table_2b_df)
)

It's not that simple though, since each of these tables will also need a subtable title. Would it be awkward to add another (optional) argument to create_a11ytable(), like subtable_titles? Probably, since it likely requires list(list(list())).

create_a11ytable(
  tab_titles c("cover", "contents", "notes", "tables", "tables"),
  sheet_types = c("cover", "contents", "notes", "tables", "tables"),
  sheet_titles c("Publication", "Contents", "Notes", "Table 1", "Table 2"),
  tables = list(
    table_1_df, 
    list(
      list(
        "Table 2a: This is the first subtable",
        table_2a_df
      ),
      list(
        "Table 2b: This is the second subtable",
        table_2b_df
      )
    )
  )
)

This is inelegant obviously. The tables argument was intended to be a method for providing only table-like objects. But how else could this be dealt with? An {a11ytables2} approach that embraces lists from the get-go may be preferable.

@matt-dray
Copy link
Collaborator Author

matt-dray commented Dec 27, 2023

Remember the best practice guidance for multiple tables in a sheet, including:

  • the worksheet title should be e.g. 'Worksheet 1: Title' and the subtable titles in the form e.g. 'Table 1a: Title' and 'Table 1b: Title'
  • The note on the number of tables should expand to: ‘This worksheet contains [e.g. eight] tables presented next to each other horizontally with one blank column in between each table. Each table applies to [e.g. a different age group].’

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Meeting the guidelines enhancement New feature or request priority: on ice Do much later, maybe never
Projects
None yet
Development

No branches or pull requests

1 participant