Reputation: 47
I use:
rails 4.2.1
gem 'jquery-datatables-rails', '~> 3.3.0'
gem 'ajax-datatables-rails', '~>0.3.0'
gem 'bootstrap-sass', '~> 3.3.5'
Responsive extra works at normal browser window, when I resize. But doesn't work on mobile phones or in mobile view in chrome.
I'm was trying:
when I try to look table from datatables.net in mobile mode, everything is OK
Screenshots here
Upvotes: 3
Views: 399
Reputation: 58880
Add this in your HTML after <head>
tag:
<meta name="viewport" content="width=device-width,initial-scale=1">
According to the documentation:
A typical mobile-optimized site contains something like the following:
<meta name="viewport" content="width=device-width, initial-scale=1">
The
width
property controls the size of the viewport. It can be set to a specific number of pixels likewidth=600
or to the special valuedevice-width
value which is the width of the screen in CSS pixels at a scale of 100%. (There are correspondingheight
anddevice-height
values, which may be useful for pages with elements that change size or position based on the viewport height.)The
initial-scale
property controls the zoom level when the page is first loaded. Themaximum-scale
,minimum-scale
, anduser-scalable
properties control how users are allowed to zoom the page in or out.
Upvotes: 1