Skip to content

[Console][Table] Apply options/style to table cells #13370

Closed
@tomzx

Description

@tomzx

It would be nice if Table was able to be styled as much as a HTML table can.

Use case: Center some cells

I think the way we can approach this with the current implementation is to add an optional $options parameter to the methods adding/setting rows.

The array would look as such:

[
    cellNumber => [
        propertyA => value,
        propertyB => value,
        colspan => value,
        rowspan => value,
        align => left|center|right,
        format => '<info>%s</info>',
    ]
]

By using keyed cell number (for a single row), we can specify data for only specific cells (does not force the user to specify an empty array for each cell).

Any undefined property implies the default values for the table.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConsoleFeatureHelp wantedIssues and PRs which are looking for volunteers to complete them.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions