Skip to content

Enable tables to carry a title or footer #160

@yoshuawuyts

Description

@yoshuawuyts

A detailed description of the feature you would like to see added.

I was looking to implement bytecodealliance/wasm-tools#1923 using comfy-table to get a duf-like output, but it doesn't seem comfy-table is able to set titles. It would be neat if it could though.

Explain your usecase of the requested feature

When printing many tables in a row, being able to render a title adds some visual rhythm, making it easier to scan for the section you're looking for.

Alternatives

No response

Additional context

This is the output I'm trying to create:

ascii tables in a terminal

┌──────────────────────────────────────┐                                            
│ component sample-wasi-http-rust      │                                            
├──────────┬────────────────┬──────────┤                                            
│ KIND     │ PRODUCER       │ VERSION  │                                            
├──────────┼────────────────┼──────────┤                                            
│ tool     │ wit-component  │ 0.216.0  │                                            
└──────────┴────────────────┴──────────┘                                            
┌──────────────────────────────────────────────────────────────────────────────────┐
│ module sample_wasi_http_rust.wasm                                                │
├──────────┬──────────────────┬────────────────────────────────────────────────────┤
│ KIND     │ PRODUCER         │ VERSION                                            │
├──────────┼──────────────────┼────────────────────────────────────────────────────┤
│ language │ Rust             │ -                                                  │
├──────────┼──────────────────┼────────────────────────────────────────────────────┤
│ language │ C11              │ -                                                  │
├──────────┼──────────────────┼────────────────────────────────────────────────────┤
│ tool     │ rustc            │ 1.82.0 (f6e511eec 2024-10-15)                      │
├──────────┼──────────────────┼────────────────────────────────────────────────────┤
│ tool     │ clang            │ 18.1.2-wasi-sdk                                    │
│          │                  │ (https://github.com/llvm/llvm-project              │
├──────────┼──────────────────┼────────────────────────────────────────────────────┤
│ tool     │ wit-component    │ 0.20.1                                             │
├──────────┼──────────────────┼────────────────────────────────────────────────────┤
│ tool     │ wit-bindgen-rust │ 0.20.1                                             │
├──────────┼──────────────────┼────────────────────────────────────────────────────┤
│ tool     │ wit-bindgen-c    │ 0.20.1                                             │
└──────────┴──────────────────┴────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────┐                            
│ module wit-component:adapter:wasi_snapshot_preview1: │                            
├──────────┬──────────┬────────────────────────────────┤                            
│ KIND     │ PRODUCER │ VERSION                        │                            
├──────────┼──────────┼────────────────────────────────┤                            
│ language │ Rust     │ -                              │                            
├──────────┼──────────┼────────────────────────────────┤                            
│ tool     │ rustc    │ 1.82.0 (f6e511eec 2024-10-15)  │                            
└──────────┴──────────┴────────────────────────────────┘                            
┌────────────────────────────────────┐                                              
│ module wit-component-shim          │                                              
├──────────┬───────────────┬─────────┤                                              
│ KIND     │ PRODUCER      │ VERSION │                                              
├──────────┼───────────────┼─────────┤                                              
│ language │ Rust          │ -       │                                              
├──────────┼───────────────┼─────────┤                                              
│ tool     │ wit-component │ 0.216.0 │                                              
└──────────┴───────────────┴─────────┘                                              
┌────────────────────────────────────┐                                              
│ module wit-component:fixups        │                                              
├──────────┬───────────────┬─────────┤                                              
│ KIND     │ PRODUCER      │ VERSION │                                              
├──────────┼───────────────┼─────────┤                                              
│ language │ Rust          │ -       │                                              
├──────────┼───────────────┼─────────┤                                              
│ tool     │ wit-component │ 0.216.0 │                                              
└──────────┴───────────────┴─────────┘                                              

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions