使用表类添加一个类到codeigniter中的特定行 [英] add a class to particular row in codeigniter using table class

查看:163
本文介绍了使用表类添加一个类到codeigniter中的特定行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用表类添加类到codeigniter中的特定行?

How can I add a class to particular row in codeigniter using table class?

推荐答案

以相同的方式,您可以向其他元素添加额外的属性CI风格。然而,您可以向每个td IN A ROW添加一个类,然后对该类进行操作,因为它引用了整行:

You can't add a class to a row in the same way you can added extra attributes to other elements CI-style. You can, however, add a class to every td IN A ROW, and then operate on the class as it references the entire row:

$td1 = array(
    'data'  => '/*actual html you want in the td*/',
    'class' => 'myclass'
);
$table->add_row($td1);

这是令人讨厌的做每一个td像这样,这不是真的你想要的必须做,但它是我见过的所有解决方案中最好的。

It's annoying to have to do every single td like that, and it isn't really what you want to have to do, but it's the best out there from all the solutions that I've seen.

这篇关于使用表类添加一个类到codeigniter中的特定行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆