Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 44

Iaxia
I hate code!
Profile
Posts: 108
Reg: Feb 04, 2012
Toronto
7,080
04/26/13 08:15 AM (12 years ago)

Different html displayed for tablet vs phone

I've looked but haven't found a solution. I have an html file with a simple, two column table. It looks great on phones, in that the entire table is displayed, but silly on a tablet... because half of the iPad screen is blank. I'd really like to be able to show one HTML file if a user is using a tablet and another if they're on an iPhone. Alternatively, it'd be awesome if the table would automatically adjust to fit the screen width -- Any ideas?
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
04/26/13 08:25 AM (12 years ago)
What metadata do you have in the html head? You could try something like this if you haven't already: <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> <meta name="apple-mobile-web-app-capable" content="yes" />
 
Iaxia
I hate code!
Profile
Posts: 108
Reg: Feb 04, 2012
Toronto
7,080
like
04/26/13 08:30 AM (12 years ago)
Wow... that was easy (for you). I'll take a look when I've got my iPad in hand. Thanks for the help.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
04/26/13 08:36 AM (12 years ago)
Might need more work yet! Post your results here, I'll be around later. I don't know how you've built your table, the dimensions might need to be percentages rather than px.
 
Iaxia
I hate code!
Profile
Posts: 108
Reg: Feb 04, 2012
Toronto
7,080
like
05/19/13 08:12 AM (12 years ago)
Thanks for the advice.. but it didn't quite work for my problem. However, I was able to figure out how to modify things on my own. For those that are interested... the solution was to add a table width tag. <table width="100%" table border="0" cellpadding="0" cellspacing="0">
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
05/19/13 08:27 AM (12 years ago)
Yes, as I said above, table dimensions in percentages.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.