title: In django-tables2, make number of rows displayed depend on screen size?
body: <p>When using django-tables2, use the <code>paginate</code> parameter to limit the number of rows displayed. For instance, if I have the table <code>my_table</code>, then in <code>views.py</code> I set it to display 10 rows as follows:</p>
  
  <pre><code>RequestConfig(request, paginate={'per_page':10}).configure(my_table)
  </code></pre>
  
  <p>My problem is that in my app I want the number of rows shown per page to depend on how big the user's screen is. For instance, 10 rows for mobile devices, but 25 rows for desktop screens. I am imagining doing in <code>views.py</code> what you can do with style sheets using the media rule (e.g., <code>@media(max-height: 480px) {do something}</code>). </p>
  
  <p>Unfortunately, my (noob) understanding is that in Django, the view is relatively insulated from low-level parameters like screen size. However, I don't want to implement some scheme like sending information from the template to the view if there is already a simple solution baked into django-tables2 that I am just ignorant of. </p>
  
  <p>Note I am using Bootstrap4 for my front end, if that makes any difference. The point is that I am already importing Javascript and jQuery into the project, at least at the template level.</p>
  
  <p><strong>Related general discussion</strong><br>
  Interestingly, I haven't seen a lot of discussion of adapting table row count to media type, but there is obviously tons of more general discussion of responsive media-sensitive design:     </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/21574881/responsive-design-with-media-query-screen-size">Responsive design with media query : screen size?</a></li>
  <li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/CSS/@media</a></li>
  </ul>