Skip to content

improve table template to work better out of the box if data labels change #40

@DanielJWood

Description

@DanielJWood

Is it worth writing a script that auto generates the columnheaders, and row syntax, instead of you doing it manually each time. Potentially this could be a script run in the google doc in an app script, or something run locally. Basically, ingest column names, spit out html. For instance, for the columns: foo, bar, baz you would get the following:

	<tr>
        <th role="columnheader">
          <div class="sorter"><div class="icon"></div></div>
          <div class="header"><%= COPY.labels.hdr_foo %></div>
        </hr>
        <th role="columnheader">
          <div class="sorter"><div class="icon"></div></div>
          <div class="header"><%= COPY.labels.hdr_bar %></div>
        </hr>
        <th role="columnheader">
          <div class="sorter"><div class="icon"></div></div>
          <div class="header"><%= COPY.labels.hdr_baz %></div>
        </hr>
    </tr>

and

<tr class="tk" role="row">
 <td role="cell" data-title="<%= COPY.labels.hdr_foo %><%= row.foo %></td>
 <td role="cell" data-title="<%= COPY.labels.hdr_bar %><%= row.bar %></td>
 <td role="cell" data-title="<%= COPY.labels.hdr_baz %><%= row.baz %></td>
</tr>

Of course there is always further customization that happens from this point but it could save a bit of time in reformatting the index.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions