开发者

Joomla 1.5 - how to create a table in a component's view's template?

开发者 https://www.devze.com 2022-12-20 20:36 出处:网络
I\'m trying to create a Joomla component that displays th开发者_开发问答e contents of a database table as a table on-screen. In the com_<name>/views/<name>/view.html.php file, what is the

I'm trying to create a Joomla component that displays th开发者_开发问答e contents of a database table as a table on-screen. In the com_<name>/views/<name>/view.html.php file, what is the best way to create an HTML table that looks like a standard Joomla table? Do I create the HTML table manually and decorate it with some CSS classes, or is there a standard Joomla class/function available to do this?


Ask yourself, do you need to use PHP to generate it? If Joomla has a method that does, it doesn't mean you need to use it. Save the PHP cycles for more important things.

If you're not doing anything special other than creating a table then that's my answer, otherwise provide me with a bit more information and I'll expand on it for you.

Update

Styling the table depends on the theme you're using. They should look the same if the CSS was done correctly. If not, find another page where a table is being used and take a look at the source code to see what classes or ids it has applied.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号