In my iPhone application I am using HTML tags to show the data in table format but I have to reduce font for the same. This is my code
- (void) setStats:(NSArray*)stats {
NSString * htmlString;
if ( [UIHelper isPad] )
htmlString = @"<html><style type=\"text/css\">body{padding:15px 40px 0 40px; font-family: Helvetica;"
"font-size: 16px;"
"color: #888888"
"},</style><body><table cellpadding=4>";
else
htmlString = @"<html><style type=\"text/css\">body{padding:8px 20px 0 20px; font-family: Helvetica;"
"font-size: 11px;"
"color: #888888;"
"},</style><body><p align=\"left\">";
for ( NSDictionary *val in stats ) {
NSString *statTitle = [NSString stringWithFormat:@"%@", [val objectForKey:@"title"]];
NSString *statValue = [NSString stringWithFormat:@"%@", [val objectForKey:@"value"]];
NSString * str = [NSString stringWithFormat:@"<tr><td width=\"60%%\">%@</td><td width=\"40%%\">%@</td></tr>", statTitle, statValue];
htmlString = [NSString stringWithFormat:@"%@%@", htmlString, str];
}
htmlString = [NSString stringWithFormat:@"%@%@", htmlString, @"</table></body></html>"];
if ( [contentView respondsToSelector:@selector(loadHTMLString:baseURL:)] )
[contentView loadHTMLString:htmlString baseURL:[NSURL URLWithString:@"http://www.secondprizm.com"]];
}