Skip to content

table directive #23

Closed as duplicate
Closed as duplicate

Description

@Mpdreamz

Table

Kind Link
Reference https://mystmd.org/guide/directives#directive-table
Documentation https://mystmd.org/guide/tables#table-directive

Implementation

  • Parses directives and aliases
  • Emits HTML
  • Unit tests
  • Validation (emits, warnings and errors).

Specification compliance:

  • Argument (parsed) - An optional table caption
  • Body (parsed, required)
  • Options
    • label, name (string) - Label the table to be cross-referenced or explicitly linked to.
    • enumerated, numbered (boolean) - Turn on/off the numbering for the specific table
    • enumerator, number (string) - Explicitly set the table number
    • class (string) -CSS classes to add to your table.
      • Special classes include:
      • full-width changes the table environment to cover two columns in LaTeX
    • align (string)

Activity

  1. added
    authoring
    and removed on Nov 6, 2024
  2. KOTungseth commented on Nov 11, 2024

    @KOTungseth
    Contributor

    Context:

    I'm also including my own notes ⬇️

    Purpose

    Present data clearly: Tables organize data into rows and columns, making it easy for readers to scan, compare, and understand information at a glance. This is especially helpful for displaying structured data like specifications, configurations, and comparisons.

    Simplify complex information: When presenting complex data, such as feature comparisons, parameter descriptions, or command options, tables break the information into manageable, visually clear segments.

    Enhance readability: Tables help reduce long blocks of text, allowing users to quickly find relevant details without wading through paragraphs, which improves the overall readability of the documentation.

    Standardize layout: Consistent use of tables helps standardize how certain types of information (e.g., APIs, system requirements, error codes) are displayed, making it easier for users to recognize and understand key details across sections of the documentation.

    Facilitate comparison: Tables are particularly useful for side-by-side comparisons, enabling users to easily identify differences between versions, options, or configurations, which might be difficult to convey through prose.

    Summarize information: They provide a succinct way to summarize key points or relationships, helping users grasp the information quickly without having to read through detailed explanations.

    Best practices

    Use clear and descriptive headings: Each column should have a clear and descriptive heading that indicates the content. This helps users quickly understand what information is being presented.

    Keep tables simple and concise: Avoid overwhelming users with too much information. Limit the number of rows and columns to what is necessary to convey the essential information clearly.

    Ensure logical organization: Organize data logically within the table. Group related information together and consider the order in which users are likely to look for it.

    Provide context: When introducing a table, offer a brief explanation of its purpose and what users can expect to find in it. This contextual information can enhance understanding.

    Use alternating row colors: Implement alternating row colors (zebra striping) to improve readability, especially for larger tables. This visual differentiation helps users track their place as they read across rows.

    Limit abbreviations and jargon: Avoid excessive use of abbreviations or technical jargon in tables unless they are well-defined elsewhere. If abbreviations are necessary, provide a legend or key.

    Include units of measurement: If applicable, include units of measurement in the table headers or within the data cells. This clarity is essential for users to understand the values presented.

  3. bmorelli25 commented on Jan 14, 2025

    @bmorelli25
    Member

    There might be some elements of this directive that we want to build support for, like CSV or list tables. Or display yaml or JSON in a table.

  4. theletterf commented on Apr 14, 2025

    @theletterf
    Member

    I like MyST/rST's list-tables more than Markdown tables. I'm also fond of Markdoc's notation: https://markdoc.dev/docs/tags#table

    A simple one:

    {% table %}
    * Heading 1
    * Heading 2
    ---
    * Row 1 Cell 1
    * Row 1 Cell 2
    ---
    * Row 2 Cell 1
    * Row 2 cell 2
    {% /table %}
    

    A complex one:

    {% table %}
    * Foo
    * Bar
    * Baz
    ---
    *
    

    puts "Some code here."

    *
    {% list type="checkmark" %}
    * Bulleted list in table
    * Second item in bulleted list
    {% /list %}
    * Text in a table
    ---
    *
    A "loose" list with
    
    multiple line items
    * Test 2
    * Test 3
    ---
    * Test 1
    * A cell that spans two columns {% colspan=2 %}
    {% /table %}
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authoring

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions