Building table dynamically