Skip to content

Flutter Markdown: Allow aligning table cell content #125872

@joshpetit

Description

@joshpetit

Is there an existing issue for this?

Use case

When using flutter markdown, the text in the table cell is always aligned to the center of a table cell, horizontally and vertically. It would be my preference to be able to align the text to a specific side of the table cell.

Markdown(
              data: """
|   |   |
|---|---|
|  **09.00** | Test thing about this really long column that should wrap when doingstusfff jasijifjsai jgisajgisajigfaj jsaigfjsaigfjsai jgisajijisjgijasigfj  |
""",
              styleSheet: MarkdownStyleSheet(
                codeblockPadding: EdgeInsets.zero,
                tableBorder: TableBorder.all(color: Colors.black, width: 0),
                tableColumnWidth: IntrinsicColumnWidth(),
                tableCellsPadding: EdgeInsets.only(bottom: 10, left: 10),
                tableHeadAlign: TextAlign.start,
              ),
            ),

image

Proposal

Adding a field to the MarkdownStylesheet for aligning table cell elements

Markdown(
              data: """
|   |   |
|---|---|
|  **09.00** | Test thing about this really long column that should wrap when doingstusfff jasijifjsai jgisajgisajigfaj jsaigfjsaigfjsai jgisajijisjgijasigfj  |
""",
              styleSheet: MarkdownStyleSheet(
                codeblockPadding: EdgeInsets.zero,
                tableBorder: TableBorder.all(color: Colors.black, width: 0),
                tableColumnWidth: IntrinsicColumnWidth(),
                tableCellsPadding: EdgeInsets.only(bottom: 10, left: 10),
                tableHeadAlign: TextAlign.start,
               // Allow aligning content of table cells
                tableCellAlignment: Alignment.topCenter,

              ),
            ),

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: flutter_markdownflutter/packages flutter_markdownpackageflutter/packages repository. See also p: labels.r: invalidIssue is closed as not validteam-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions