Welcome Guest, Not a member yet? Register   Sign In
Remove header values using HTML Table Class

I am using the HTML Table Class to generate a table via data from my db. How do I remove the heading values that get carried across from my sql code.

Eg: the below sql would output the header col-1 and col-2


$query = $this->db->query("SELECT col-1, col-2 FROM my_table");

echo $this->table->generate($query);

The aim is to create a table in the following format:

<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <th scope="row">&nbsp;</th>

EDIT: fixed set_header() to say set_heading(). The manual page for the HTML Table class is a good place to start learning about the set_heading() method.

have already looked at that but it does not say anything about table headers.


So, you want to be able to change what is in the th cell? set_heading() method will allow you to do that. send it your nbsp.

um... this is copied directly from the generate() method:
// Is there a table heading to display?
        if (count($this->heading) > 0)
            $out .= $this->template['heading_row_start'];
            $out .= $this->newline;        

            foreach($this->heading as $heading)
                $out .= $this->template['heading_cell_start'];
                $out .= $heading;
                $out .= $this->template['heading_cell_end'];

            $out .= $this->template['heading_row_end'];
            $out .= $this->newline;                
It says "if heading has been set then use the heading_cell_ template values to construct a heading row."

If this is not what you are asking, then your question needs to be restated with code.

Theme © iAndrew 2016 - Forum software by © MyBB