Skip to content

Bug: View HTML Table class displays tag attributes as columns  #8361

@eSkiSo

Description

@eSkiSo

PHP Version

8.2

CodeIgniter4 Version

4.4.3

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

Linux

Which server did you use?

apache

Database

MySQL 8

What happened?

When using the addRow using 'data'with cell tag attributes (class, colspan, etc), the cell tags attributes will be displayed as columns

Steps to Reproduce

$table = new \CodeIgniter\View\Table();
$table->addRow(['data' => 'Blue', 'class' => 'highlight', 'colspan' => 2]);
echo $table->generate();

Expected Output

Expected:

<td class='highlight' colspan='2'>Blue</td>

What it outputs:

<td>Blue</td><td>highlight</td><td>2</td></tr>

Anything else?

Please notice that if you add another 'column' on the same addRow it will output correctly:

$table->addRow(['data' => 'Blue', 'class' => 'highlight', 'colspan' => 2], 'Red');

Outputs:

<td colspan="2" class="highlight">Blue</td><td>Red</td></tr>

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixCurrent code behavior being reported or fixed is intentional and won't be changed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions