Hi @naveen,
You can check the property of the table by opening the left-panel. Clicking the table component you want to export as csv should have property of displayedData and displayedDataIndices. You can refer to my answer on this thread on exporting this table.
For the first question, I think you'd want to use either of the properties above and check their length (should always be the same).
For the second question, displayedData will be the one you want to access instead of just table1.data for export.