Skip to content

center columns in to md #14552

Open
Open
@a-stevan

Description

Related problem

i thought it would be cool to provide some alignment support to to md.

Describe the solution you'd like

if i consider the following sample table

let t = version | select version build_time | transpose k v
#┬────k─────┬────────────v─────────────
0│version   │0.100.0
1│build_time│2024-11-21 11:32:58 +01:00
─┴──────────┴──────────────────────────

running to md --pretty on $t would give

| k          | v                          |
| ---------- | -------------------------- |
| version    | 0.100.0                    |
| build_time | 2024-11-21 11:32:58 +01:00 |
k v
version 0.100.0
build_time 2024-11-21 11:32:58 +01:00

what about a --center option that would take a column name and center it?

$t | to md --pretty --center v
| k          | v                          |
| ---------- |:--------------------------:|
| version    | 0.100.0                    |
| build_time | 2024-11-21 11:32:58 +01:00 |
k v
version 0.100.0
build_time 2024-11-21 11:32:58 +01:00

Describe alternatives you've considered

No response

Additional context and details

No response

Metadata

Assignees

No one assigned

    Labels

    delightthis feature would delight usersenhancementNew feature or requestfile-formatParsing/Writing of file formats/protocols

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions