title: How to handle Django Pagination with Nested tabs
body: <p>I want to add pagination to my template,My template have Nested Tab(see code), all My inner tabs contain a table and i want to add pagination to all my tables in my inner tabs.</p>
  
  <p>I have so far added pagination to one of my table and it works but the problem is whenever page refresh it goes my to first tab <code>&lt;!-- overview--&gt;</code> , not the one that made the request, although pagination is working.</p>
  
  <p>This is the structure of my tabs.I am not using custom JS or CSS, only BS4 class </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="tab-content" id="nav-tabContent"&gt;
     &lt;!--OVERVIEW TAB--&gt;
     &lt;!--STATIC TAB--&gt;
         &lt;!--TAB 1--&gt;
         &lt;!--TAB 2--&gt;
     &lt;!-- FILES TAB--&gt;
         &lt;!--TAB 1 --&gt;
         &lt;!--TAB 2 --&gt;
         &lt;!--TAB 3 --&gt;
     &lt;!--Registry TAB --&gt;
         &lt;!--TAB 1 --&gt;
         &lt;!--TAB 2 --&gt;
     &lt;!--Network TAB--&gt;
         &lt;!--TAB 1 --&gt;
         &lt;!--TAB 2 --&gt;
         &lt;!--TAB 3 --&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/HFzWo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HFzWo.png" alt="enter image description here"></a></p>
  
  <p><strong>TEMPLATE.html</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;nav aria-label="Page navigation"&gt;
             {% if strings.has_other_pages %}
             &lt;ul class="pagination justify-content-center pagination-lg"&gt;
                {% if strings.has_previous %}
                &lt;li class="page-item"&gt;&lt;a class="page-link" href="?page=1"&gt;First&lt;/a&gt; &lt;/li&gt;
                {% endif %}
  
                {% for i in strings.paginator.page_range %}
                   {% if strings.number == i %}
               &lt;li class="page-item active"&gt;&lt;a class="page-link" href="{{ i }}"&gt;{{ i }}&lt;/a&gt;&lt;/li&gt;
                   {% elif i &gt; strings.number|add:'-3' and i &lt; strings.number|add:'3' %}
               &lt;li&gt;&lt;a class="page-link" href="?page={{ i }}"&gt;{{ i }}&lt;/a&gt;&lt;/li&gt;
                   {% endif %}
                {% endfor %}
  
                {% if strings.has_next %}
  &lt;li class="page-item"&gt;&lt;a class="page-link" href="?page={{ strings.paginator.num_pages }}"&gt;Last&lt;/a&gt; &lt;/li&gt;
                {% endif %}
              &lt;/ul&gt;
              {% endif %}
  &lt;/nav&gt;
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <pre class="lang-py prettyprint-override"><code>def viewable(request):
      if request.method == 'GET':
          page = request.GET.get('page', 1)
  
          strings = [ 'a','b','c'] #There are about 2000 entries in this list
  
   #STRING PAGE PAGINATOR
          stringspaginator = Paginator(strings,100)
          try:
              strings = stringspaginator.page(page)
          except PageNotAnInteger:
              strings = stringspaginator.page(1)
          except EmptyPage:
              strings = stringspaginator.page(stringspaginator.num_pages)
  
           return render(request, 'viewable.html', {"metadata" : metadata,
                                                   "folders_created": folders_created,
                                                   "files_created": files_created ,
                                                   "files_deleted":files_deleted,
                                                  "registry_written":registry_written,
                                                   "registry_deleted": registry_deleted,
                                                   "http":http,
                                                   "tcp":tcp,
                                                   "udp":udp,
                                                   'positives': positives,
                                                   'negatives': negatives,
                                                   'libs': libs,
                                                   'strings': strings
                                                   })
  </code></pre>
  
  <p>Now my understanding is i should add tab in my GET request that is making the request and based upon that it should redirect to proper tab, but i have no idea how. or even if that is the right solution. </p>
  
  <blockquote>
    <p>I am sending a lots of variables to my template that is then displayed in multiple tables, i don't think this is the best solution for handling that much amount of data but i am a beginner and right now that the only way i know .</p>
  </blockquote>