# Paging table

**URL:** <https://forum.inductiveautomation.com/t/paging-table/12717>\
**Category:** Ignition\
**Created:** [February 24, 2017, 7:36pm UTC](https://forum.inductiveautomation.com/t/paging-table/12717 "2017-02-24T19:36:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![StepanenkoPaul](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@StepanenkoPaul](https://forum.inductiveautomation.com/u/StepanenkoPaul)\
**Post date:** [February 24, 2017, 7:36pm UTC](https://forum.inductiveautomation.com/t/paging-table/12717/1 "2017-02-24T19:36:48Z")

</div>

May be who knows how make table with paging?  
Example: i have 100 rows in dataset. I need display in table only 20 rows. And using buttons to switch next page with 20 rows

---

<div class="post-metadata">

**Author:** ![anna](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@anna](https://forum.inductiveautomation.com/u/anna)\
**Post date:** [February 24, 2017, 8:43pm UTC](https://forum.inductiveautomation.com/t/paging-table/12717/2 "2017-02-24T20:43:29Z")

</div>

Paul,

You would do something like this:

[code]  
from javax.swing import SwingUtilities  
from javax.swing import JScrollPane

rows = 21  
table = event.source.parent.getComponent(‘Table’)  
height = table.getRowHeight()\*(rows-1)

scrollPane = SwingUtilities.getAncestorOfClass(JScrollPane, event.source.parent.getComponent(‘Table’).getComponents()[1])  
scrollBar = scrollPane.getVerticalScrollBar()  
scrollBar.setValue(scrollBar.getValue()+ height)[/code]

The code above, placed in a button’s actionPerformed script, will scroll the table down to display the next 20 rows in the dataset.  
You can use similar logic for scrolling up, etc.  
The code implies that the table height is set to show only 20 rows at a time.
