CodeIgniter中的表类和页面视图

My welcome controller coded like this,

function index()
{
    // some code here to set up my table
    echo $this->table->generate();

    $data['heading'] = "My Real Heading";

    $this->load->view('view_page', $data);
}

When I open http://localhost/ci/index.php/welcome/

I found the table generated successfully. but how can I place my table showed under my Heading? My confused that, the table class generated by module function. It will finished before the view page load. That's why the issue occurred.

[Updated].

I found echo $this->table->generate(); could be place into my view page. It works now.

function index()
{
    // some code here to set up my table
    $data['myTable'] = $this->table->generate(); 
   //assign result to a variable in the $data array 

    $data['heading'] = "My Real Heading";

    $this->load->view('view_page', $data);
}

in your view:

<!-- html -->
echo $heading;
echo $myTable;