Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add ability to add row in a loop to existing already-rendered table #166

Open
@slaFFik

Description

Feature Request

Describe your use case and the problem you are facing

I want to "register" an empty table, and then later in a loop using table reference ($table) add rows.

Right now if I register a table, call the display() method to render it, and then later call the

$table->addRow(); 
$table->display();

it will render the whole table again - with headers and previously added rows.

Describe the solution you'd like

I think separating resetTable() method into individual methods for header, rows, footer is needed.

So I should be able to either do this:

$table->setHeaders();
$table->display();
foreach ($rows as $row) {
	$table->resetRows();
	$table->addRow($row);
	$table->display();
}

or something like this:

$table->setHeaders();
$table->display();
foreach ($rows as $row) {
	$table->displayRow($row);
}

Also, because header is a mandatory table data, displaying a new row should not render the top border but render the bottom row.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /