Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to add HTML attributes to a table row such as class or id #2540

Closed
wants to merge 1 commit into
base: develop
from

Conversation

Projects
None yet
2 participants
@dalehurley
Copy link

dalehurley commented Jul 19, 2013

Updated the _prep_args method so data can be passed for a row intended to have attributes such as class and id.

Updated the generate method so attributes such as class and id can be added to rows.

    //add the row to the rows array
    $rows[]=array('data'=>$row, 'class'=>'warning');
    echo $this->table->generate($rows);

or

    $this->table->add_row(array('data'=>$row, 'class'=>'warning'));
Ability to add HTML attributes to a table row such as class or id
Updated the _prep_args method so data can be passed for a row intended to have attributes such as class and id.

Updated the generate method so attributes such as class and id can be added to rows.

//add the row to the rows array
$rows[]=array('data'=>$row, 'class'=>'warning');
echo $this->table->generate($rows);

or

$this->table->add_row(array('data'=>$row, 'class'=>'warning'));
@narfbg

This comment has been minimized.

Copy link
Contributor

narfbg commented Feb 11, 2014

Sorry, but ... no.
I like it, but one of the (array vs. string) usages must go away for this to be sanely implemented. Otherwise, we're just making a bigger mess out of it. :/

@narfbg narfbg closed this Feb 11, 2014

@dalehurley

This comment has been minimized.

Copy link
Author

dalehurley commented Feb 11, 2014

I think you have been extremely short sighted.

This is such an oversight to ignore the need for the ability to add classes to table rows.

Zurb Foundation and Twitter Bootstrap and many other modern HTML frameworks applies classes to table row. There is many great use cases for classes to be added to table rows.

The only reason for adding in the array/string usages is to match the current implementation.

@narfbg

This comment has been minimized.

Copy link
Contributor

narfbg commented Feb 11, 2014

I think you have been extremely short sighted.

I think this is offensive.

This is such an oversight to ignore the need for the ability to add classes to table rows.

I spent 2 hours of my own time trying to implement this in an appropriate way - that's not ignorance. With how the library currently works, this is simply just not achievable.

As I said - I myself like that feature, which (unlike your assumptions so far) actually implies that I also think it is a need. But while it might work for you, it will not be universal and that's a big factor.

If/when the possibility to pass strings to add_row() is removed, it will be implemented.

Zurb Foundation and Twitter Bootstrap and many other modern HTML frameworks applies classes to table row.

CodeIgniter is not Zurb Foundation or Twitter Bootstrap.
CodeIgniter is not an HTML framework.
And frankly, even if it was - another framework's feature isn't the basis for implementing the same feature in CodeIgniter.

There is many great use cases for classes to be added to table rows.

Who said there aren't?

The only reason for adding in the array/string usages is to match the current implementation.

This sentence doesn't make any sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.