Skip to content

Automatically Infer table headers #92

@Mr0grog

Description

@Mr0grog

With well formed tables, Google Docs outputs nice <thead> and <tbody> markup we use to create nice Markdown tables. However, people frequently format header rows visually as headers but fail to actually make them headers in Google Docs (the table at the bottom of. this doc is an example, as of 2023-08-21: https://docs.google.com/document/d/1Voa0_i1q8ZCtQkNPPJiNFqy7vhmTzGPthOFRfr4Ledw/edit), which results in disappointing Markdown output where the headers are not headers:

|                    |                |                    |                                                |
| :----------------: | :------------: | :----------------: | :--------------------------------------------: |
| **VERSION NUMBER** | **REVISED BY** | **EFFECTIVE DATE** |      **DESCRIPTION OF CHANGES**                |
|        1.0.0       | City CIO       |      7/14/2023     | First detailed version of DoIT Strategic Plan  |
|                    |                |                    |                                                |
|                    |                |                    |                                                |

It would be nice use some heuristics to detect this scenario and automatically correct it. Some ideas:

  • All values for a particular column are numeric except the first row.
  • All rows have the same alignment for each column except the first row.
  • First row has a background color on all cells, and no other rows have that background.
  • First row is all bold, no other rows are.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestinput cleanupFeatures to take bad input and produce better output

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions