Introduction (Previous) (Next) HTML_Table::HTML_Table

View this page in Last updated: Sun, 01 Jul 2007
English | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Plain HTML

FAQ

FAQ -- Answers to most Frequently Asked Questions

Descripción

This document is based on questions asked on PEAR general mailing list and other mailing lists and forums.

HTML_Table FAQ

1. How can I add attributes to the thead, tfoot or tbody tags?
2. How can I set attributes for the table tag?

1. How can I add attributes to the thead, tfoot or tbody tags?

Here is an example on how to set the attribute string id="header" for the thead tag. For the other two tags the procedure is similar.


<?php
$table = new HTML_Table();
// [...]
$thead =& $table->getHeader();
$thead->setAttributes(array('id' => 'header'));
// [...]
$table->display();
?>

This would give the following result:

<table>
  <thead id="header">
    [...]
  </thead>
  [...]
</table>

2. How can I set attributes for the table tag?

Besides the possibility to pass attributes to the HTML_Table constructor, there are several more methods that can be used.

HTML_Table extends HTML_Common which offers methods like setAttributes() or updateAttributes(). A complete list of methods provided by HTML_Common can be found in its API documentation.

Introduction (Previous) (Next) HTML_Table::HTML_Table

Download Documentation Last updated: Sun, 01 Jul 2007
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.