You can refer this sample for help:
http://github.com/penso/webview-in-tableview
Try this code:
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"Webview in UITableView";
webview = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 10)]; // Don't use CGRectZero here, won't work
webview.delegate = self;
webview.hidden = YES;
[webview loadRequest:[[NSURLRequest alloc]
initWithURL: [NSURL URLWithString:@"http://www.google.com/"]]];
[self.tableView setTableFooterView:webview]; // Leave this, else you'll have rows to fill the rest of the screen
}
- (void) webViewDidFinishLoad:(UIWebView *)webView {
float newSize = [[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.scrollHeight"] floatValue];
NSLog(@"Resizing webview from %.2f to %.2f", webView.frame.size.height, newSize);
webView.frame = CGRectMake(webView.frame.origin.x, webView.frame.origin.y, webView.frame.size.width, newSize);
webView.hidden = NO;
// We need to reset this, else the new frame is not used.
[self.tableView setTableFooterView:webview];
}