<p>I have never used it, but there is a method <a href="http://buildwithcraft.com/docs/templating/craft.request#isMobileBrowser" rel="nofollow">craft.request.isMobileBrowser()</a>.</p>

<pre><code>{% if not craft.request.isMobileBrowser() %}
    &lt;td&gt;non-mobile browser column&lt;/td&gt;
{% endif %}
</code></pre>

<p>or even better, you could give that column a class, and then include a mobile css file to layout the table for mobile:</p>

<pre><code>{% if not craft.request.isMobileBrowser() %}
   {% includeCssFile "/assets/css/mobile.css" %}
{% endif %}
</code></pre>

CC BY-SA 3.0
2014-12-09T01:22:37.850Z
Why would I hide the table on a huge Phone that might be perfectly suitable to show it? I'd use media queries instead.
carlcs
CC BY-SA 3.0
2014-12-09T06:13:30.950Z
I just answer questions.... I don't ask why ;)
Douglas McDonald
CC BY-SA 3.0
2014-12-09T21:32:41.133Z
Media queries is probably the best option.
Adam
CC BY-SA 3.0
2014-12-08T17:13:04.837Z
2014-12-08T18:17:53.960Z
2014-12-08T18:17:53.960Z
Douglas McDonald
<p>My custom plugin uses a table to display each of my results, works as intended. However, on the mobile device the table does not layout properly as the table has 6 columns. </p>

<p>I know this is a rather simple task that can be handled with media queries, but is there a way to use the native CSS/tools that craft provides?</p>

CC BY-SA 3.0
2014-12-09T01:18:37.937Z
Why hide it? Why don't you aim for a solution that displays it properly in a responsive / scrollable table?
carlcs
CC BY-SA 3.0
2014-12-09T02:13:35.567Z
Tables and responsive don't go together in my opinion. Also the table works fine, until you get past four columns of data on mobile. I'm only looking to hide the last few on mobile so it appears as designed.
Jason McCallister
CC BY-SA 3.0
2014-12-09T07:46:16.743Z
Have a look at ["table-saw"](https://github.com/filamentgroup/tablesaw) or other example code like [here](http://zurb.com/playground/responsive-tables).
carlcs
<plugin-development><css>
Hiding my plugin table columns for mobile
# Hiding my plugin table columns for mobile

(Asked by: username_0 on 2014-12-06)

My custom plugin uses a table to display each of my results, works as intended. However, on the mobile device the table does not layout properly as the table has 6 columns.

I know this is a rather simple task that can be handled with media queries, but is there a way to use the native CSS/tools that craft provides?

**Tags:** plugin-development, css
> **Comments:**
> **username_1**: Why hide it? Why don't you aim for a solution that displays it properly in a responsive / scrollable table?  
> **username_0**: Tables and responsive don't go together in my opinion. Also the table works fine, until you get past four columns of data on mobile. I'm only looking to hide the last few on mobile so it appears as designed.  
> **username_1**: Have a look at ["table-saw"](https://github.com/filamentgroup/tablesaw) or other example code like [here](http://zurb.com/playground/responsive-tables).  

---

## 1 answers

### Answer by username_2 on 2014-12-08. Score: 3

I have never used it, but there is a method craft.request.isMobileBrowser().
{% if not craft.request.isMobileBrowser() %}
    non-mobile browser column
{% endif %}

or even better, you could give that column a class, and then include a mobile css file to layout the table for mobile:
{% if not craft.request.isMobileBrowser() %}
   {% includeCssFile "/assets/css/mobile.css" %}
{% endif %}

> **Comments:**
> **username_1**: Why would I hide the table on a huge Phone that might be perfectly suitable to show it? I'd use media queries instead.  
> **username_2**: I just answer questions.... I don't ask why ;)  
> **username_3**: Media queries is probably the best option.  

---

