How to create table/data grid for mobile devices using HTML/CSS/JavaScript
I want to show a table/data grid as shown below, this is for mobile devices like iPhone and Andr开发者_StackOverflow中文版iod phones. Are there any examples for this? (using plain HTML/CSS/JavaScript)
If you have the HTML, CSS, etc. ready and working, you can use UIWebView class on iOS/iPhone to view your HTML file.
NSString *htmlString = @"<html>.......</html>";
NSURL *baseURL = [NSURL URLWithString:@""];
[myWebView loadHTMLString:htmlString baseURL:baseURL];
Basic example: Display HTML Table in webview
I had to do something like this when developing using jQTouch. I simply created an Edge-to-edge list with one item, and place a table inside it:
<ul class="edgetoedge">
<li>
<table sytle="width:100%; text-align: center; padding: 5px">
<tr><td>Row 1-1</td><td>Row 1-2</td><td>Row 1-3</td></tr>
<tr><td>Row 2-1</td><td>Row 2-2</td><td>Row 2-3</td></tr>
</table>
</li>
</ul>
Then style the table (i.e. <table>
, <tr>
, and <td>
) to your heart's content.
精彩评论