Welcome Guest, Not a member yet? Register   Sign In
modify class Table to add class in a cell or attrib!!!!
#1

[eluser]mashary[/eluser]
Nobody answer me at http://ellislab.com/forums/viewthread/165596/

LOL

so this morning just start to modify main class Table

at line 261
Code:
$out .= $this->template['cell_'.$name.'start'];      
if ($cell === "")
{
$out .= $this->empty_cells;
}
else
{
$out .= $cell;
}
$out .= $this->template['cell_'.$name.'end'];

and i rewrite that line with

Code:
if ( is_array($cell) )
{              
$out .= '<td '.$cell[1].'>';
if ($cell[0] === "")
{
  $out .= $this->empty_cells;
}
else
{
  $out .= $cell[0];
}
  $out .= '</td>';  
}
else
{
  $out .= $this->template['cell_'.$name.'start'];      
  if ($cell === "")
  {
   $out .= $this->empty_cells;
  }
  else
  {
   $out .= $cell;
  }              
   $out .= $this->template['cell_'.$name.'end'];            
}

so you can make special cell now

say that you need to put number in cell using attrib right center or left
so you just type this code
Code:
$table->add_row('No','Name', array('Sell','align="right" class="money"') );

just put array in a value. first arg is your value and second arg is your atrib

^_^ hope these help full




Theme © iAndrew 2016 - Forum software by © MyBB