HTML - Table not responsive in mobile view

GK User
Tue Oct 28, 2014 4:44 am
Hi Support,

Once i put a table code in html

<table style="border="0" width="100%"> contents.... </table>

The desktop view is ok but when come to mobile view, it show up a scroll bar and not responsive. Anyway to solve it?

Looking forward to your help urgently.

Many thanks.

Kelvin
User avatar
Fresh Boarder

GK User
Tue Oct 28, 2014 7:03 am
What kind of elements do you have inside of your table? Perhaps one of them is pushing table width?
User avatar
Moderator

GK User
Fri Oct 31, 2014 10:14 am
Hi
I have a very same problem and table width is 100%. But it seems that it is not a table width problem because it doesn't work even in category list.

Attached is a picture showing a very same category view with two of your templates: left: SteakHouse, right Bluap.

Steakhouse responsive template have some issues
User avatar
Senior Boarder

GK User
Sat Nov 01, 2014 10:50 am
Could you please post an url to your site?
User avatar
Moderator

GK User
Sat Nov 01, 2014 12:25 pm
The address: http://mobilis.io/supported-sensors.html and the address where everything is O.K. (bluap) is http://senseview.mobi/supported-sensors.html

Tnx
User avatar
Senior Boarder

GK User
Tue Nov 04, 2014 7:31 am
First thing - there seems to be a bug with css stylesheets ordering in this template and it will be fixed with next release. To fix it please edit file:
templates/gk_steakhouse/layouts/blocks/head.php
and move this part of code:
Code: Select all
if($this->API->get("css_override", '0')) {
    $this->API->addCSS($this->API->URLtemplate() . '/css/override.css');
}

from line 30 to 69, just under:
Code: Select all
// add responsive stylesheets
$this->generateLayout();

so it looks this way:
Code: Select all
// add responsive stylesheets
$this->generateLayout();

if($this->API->get("css_override", '0')) {
    $this->API->addCSS($this->API->URLtemplate() . '/css/override.css');
}


Then please write back.
User avatar
Moderator

GK User
Thu Nov 06, 2014 6:35 pm
Thank you for reply, I moved part of code as you suggested, but problem still exist.

Best regards
User avatar
Senior Boarder

GK User
Fri Nov 07, 2014 8:32 am
There will not be any difference in table view, it will be visible in site source code and will allow futher modification. But it looks like your modification was not made.
User avatar
Moderator

GK User
Fri Nov 07, 2014 12:32 pm
Hm, strange. I did everything you asked (screenshoot), cleared cache, restarted a server. You can check.... http://mobilis.io/supported-sensors.html
User avatar
Senior Boarder

GK User
Fri Nov 07, 2014 7:31 pm
It's more complicated problem. I'll write back as soon as I get an information from our dev team.
User avatar
Moderator

GK User
Thu Jan 08, 2015 1:38 pm
Any news? You advertize the template as Responsive, but in this case it is not, because it simply doesn't work on mobile.

Tnx
User avatar
Senior Boarder

GK User
Thu Jan 08, 2015 5:45 pm
Please modify file:
templates/gk_steakhouse/css/mobile.css

and change around line 199 from:
Code: Select all
#gkMainbody table tbody,
#gkMainbody table thead,
#gkMainbody table tfoot {
   width: 540px!important;
   display: table;
}

to
Code: Select all
#gkMainbody table tbody,
#gkMainbody table thead,
#gkMainbody table tfoot {
   width: 100%!important;
   display: table;
}


you might also want to change around line 212 from:
Code: Select all
@media only screen and (max-width: 440px) {
   #gkMainbody table {
      width:260px!important;
   }
}

to
Code: Select all
@media only screen and (max-width: 440px) {
   #gkMainbody table {
      width: 100%!important;
   }
}


Sadly it can be only done this way for the time being. You might also try to update the template to newest version where override.css is used a little bit differently and above changes might be used inside of it, but without an update I can't tell for sure (please make a backup before - sql and files)
User avatar
Moderator

GK User
Fri Jan 09, 2015 6:16 pm
I got response from our devteam - this behave is on purpose allowing to swipe through more wide tables. But in your case when the table is narrow, the scrolling is not necessary. Please let me know with the update.
User avatar
Moderator


cron