Column headers are not necessary information, as you can name them whatever you wish (in this case, images, labels).
I have more often seen the train loader being iterated as such:
for i, (images, labels) in enumerate(trainloader):
    print(type(images))

In such a case, you could get the number of items returned by the train loader with n_columns = len(trainloader[0]).