You need to be more clear on what you are trying to accomplish. Are you stating that you don't want the empty cells in your picture to be shown? If you open a Microsoft Excel Workbook you will see empty cells there too. That doesn't mean there is data there. What are your requirements?
You have to define the number of records that you want to display - it is not dynamic so I doubt it could be done. You might be able to do something with visual attributes to make it more appealing to the eye, but you would still have empty cells displaying if there wasn't data for those records.