Table class documentation Incomplete

Created on 10 December 2018, about 6 years ago
Updated 1 November 2023, about 1 year ago

Problem/Motivation

API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...

Enter a descriptive title (above) relating to class Table, then describe the problem you have found:

The documentation is incomplete and the usage example does not make sense.

The documentation lists 6 properties for a table render array. But, it leaves off two that I know of: #footer and #caption; there might be more that I don't know of. The documentation also neglects to demonstrate how to put HTML into table cells and how to implement column header sorting, pagination, etc.

The usage example is confusing. It only demonstrates the use of one of the listed properties. There is no clear use of #rows. Using a for() loop (to generate what I assume are rows??) makes the example worse.

Steps to reproduce

See documentation of in table class in core/lib/Drupal/Core/Render/Element/Table.php

Proposed resolution

Add an example using the #rows element
Add comments to the existing example (without the #rows element) to make it less confusing
Add information about #footer and #caption

Remaining tasks

a.
b. Review
c. Commit

User interface changes

NA

API changes

NA

Data model changes

NA

Release notes snippet

NA

πŸ› Bug report
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
RenderΒ  β†’

Last updated about 9 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States JasonSafro

Live updates comments and jobs are added and updated live.
  • Documentation

    Primarily changes documentation, not code. For Drupal core issues, select the Documentation component instead of using this tag. In general, component selection is preferred over tag selection.

  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024