Welcome Guest, Not a member yet? Register   Sign In
How add links, anchors, etc,. to the HTML Table Class?
#1

[eluser]Asinox[/eluser]
Hi, the HTML Table Class i think is wonderful, but, i want to ask, how ill add links , anchors, etc., to the data from html table class?

thanks u
#2

[eluser]thinkigniter[/eluser]
I don't know.
I've never tried.

How about this...

Code:
$this->table->set_heading('Name', 'Day', 'Delivery');
$this->table->add_row('<a href="#" title="Freds_name">Fred</a>', 'Wednesday', 'Express');

echo $this->table->generate();
#3

[eluser]Yash[/eluser]
add this into constructor
Code:
$this->load->helper(array('html','url'));

then in view

$this->table->set_heading('Name', 'Day', 'Delivery');
$this->table->add_row(anchor('http://somesite.com/some.php', 'Yash');, 'Wednesday', 'Express');

//read url and html

[url="http://ellislab.com/codeigniter/user-guide/"]user guide[/url]


echo $this->table->generate();
#4

[eluser]Asinox[/eluser]
Thanks u, i readed a lot about html and url, but my question is about HTML Table, because ill renerate table from database, but in the user guide dont say how make links, o something with this generate data... ill try tu method's

thanks again Smile
#5

[eluser]Yash[/eluser]
show me data u r getting from database.

it's simple to use u will learn it fast.
#6

[eluser]Asinox[/eluser]
i did it Smile

Code:
function makeColumns(){
         $contact = $this->galerias_model->listar_imagenes($this->uri->segment(4));
         foreach($contact as $cont):
         $datas[] = '<a >imagename.'" rel="lightbox[galeria]"><img src='.base_url().'>thumbnail.'></a>';
         endforeach;
         return  $this->table->make_columns($datas, 4); //6 colums maximum
    }




Theme © iAndrew 2016 - Forum software by © MyBB