Welcome Guest, Not a member yet? Register   Sign In
[2Q] Doubts about Table Class and Form population
#6

[eluser]lancemonotone[/eluser]
You can also override the $table->generate method to use sprintf to generate your <th> or <td> tags.

Before:
Code:
foreach($this->heading as $heading)
  {
    $out .= $this->template['heading_cell_start'];
    $out .= $heading;
    $out .= $this->template['heading_cell_end'];
  }

After:
Code:
foreach($this->heading as $heading)
  {
    $out .= sprintf($this->template['heading_cell_start'], $heading);
    $out .= $heading;
    $out .= $this->template['heading_cell_end'];
  }

Then, in your controller:
Code:
$tmpl = array (
    'heading_cell_start'  => '<th id="%s">'
);

$table->set_template($tmpl);


Messages In This Thread
[2Q] Doubts about Table Class and Form population - by El Forum - 10-26-2008, 09:55 PM
[2Q] Doubts about Table Class and Form population - by El Forum - 10-27-2008, 02:12 AM
[2Q] Doubts about Table Class and Form population - by El Forum - 10-28-2008, 03:46 PM
[2Q] Doubts about Table Class and Form population - by El Forum - 10-29-2008, 01:29 AM
[2Q] Doubts about Table Class and Form population - by El Forum - 11-02-2008, 03:14 PM
[2Q] Doubts about Table Class and Form population - by El Forum - 05-15-2009, 06:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB