Welcome Guest, Not a member yet? Register   Sign In
whi table generate extra <td>?
#1

[eluser]xpacio[/eluser]
my code:

Code:
$bancos=array('banamex','bancomer','hsbc','santander');
$tipo= array('ui/img/money.png','ui/img/monitor_go.png');
$campos = array('fecha_deposito','fecha_registro','banco','monto','folio','tipo','ficha','user_id');
#selecciona los campos para el usuario actual
$this->db->select($campos);
$this->db->where('estado', 0);
$query = $this->db->get( 'depositos');
if ( $query->num_rows() > 0 )
{
    $this->load->library('table');
    $this->table->clear();
    $this->table->set_heading($campos);
    $pendientes = $query->result_array();
    foreach( $pendientes as $row )
    {
        #modifica monto, concatena signo de pesos
        $row['monto'] = '$'.$row['monto'];
        #modificar banco sustituye valor por texto
        $row['banco'] = $bancos[$row['banco']];
        #modifica ficha, sustituye por icono, agrega enlace
        $row['ficha'] = anchor('fichas/show/'.$row['ficha'],img('ui/img/image_link.png'));
        #modifica tipo, sustituye por icono.
        $row['tipo'] = img($tipo[$row['tipo']]);
        #agrega columna para control

        #variable para vista
        $this->table->add_row($row);
    }
$data['pendientes'] = $this->table->generate();

and the html result:
no post beacause of spam and my few post activity

an screen to explain the problem:
http://www.imagengratis.org/?v=wrongtable.jpg

the fix i find is set $campos = array('','fecha_deposito','fecha_registro','banco','monto','folio','tipo','ficha','user_id');

what is wrong?


Messages In This Thread
whi table generate extra <td>? - by El Forum - 07-27-2011, 10:54 PM
whi table generate extra <td>? - by El Forum - 07-28-2011, 10:00 PM
whi table generate extra <td>? - by El Forum - 07-30-2011, 12:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB