You can use the dbprefix
method to include you table prefix from database.php
config file:
if ( !$CI->db->table_exists($CI->db->dbprefix('products')) ){
//there is no such table, products
echo "there is no table named ".$CI->db->dbprefix('products');
die();
}else{
//table found
echo "table found"; die();
}
In case it dose not work, then I think your problem is not this piece of code!