You should not have echo and calls to $this->load->view() within the same controller (in general, you should not use echo in a controller). Save the result of $this->table->generate($data) to a value which you can then pass to a view, or generate the table within the view.
To go into more detail: $this->load->view() buffers the output until your controller relinquishes control back to the framework, which also allows CI's Output class to perform some additional processing. By calling echo within the controller, you place data into the output stream outside of (before) the buffered views.
Libraries and/or helpers which generate portions of HTML are usually intended to be used within your views or to have their output passed to views via variables, not to generate output directly from your controllers.