Reputation: 11
I know there is this WP Touch that can automatically resize the webpage to fit iphone size. But what I want to do is to get the contents of the site, not the whole site, and display it on iphone.
I manage to get the content from wp database, the wp_posts table, post_content column, and get the content. But the problem is that, the content from wp database, include the width and height, and some of the width exceed iphone resolution. Here is the sample code from wp content:
... bla bla
<table width="980px" ...>
...
Even in my UIWebView i set the size to 300px width, the content will be chopped off. Is there any work around way to handle this problem?
EDIT:
I can only access the database, cant access the wordpress (php files)
Upvotes: 0
Views: 291
Reputation: 317
Consider using CSS Media queries. You can then set certain device sizes to display or not display some content. CSS Tricks: Media Queries
This is considered to be a much better solution because it will allow you to just maintain a single site, as opposed to multiple code bases.
Upvotes: 1
Reputation: 45210
I think that you can overwrite your table width
property via CSS rule:
table {
width:300px !important;
}
Upvotes: 0