The one-dimensional confined space within carbon nanotubes (CNTs) has a profound impact on the behavior of liquids, potentially resulting in an layering structure that differs from the bulk phase. Through a series of molecular dynamics simulations, we have observed interesting changes in the layering structure of N-butylpyridinium tetrafluoroborate ([BPy][BF4]) within different carbon nanotubes. The probability of angular distributions shows that the pyridine ring tends to be adsorbed on the inner wall of the carbon nanotube. As the diameter of the carbon nanotube increases, the layering behavior of [BPy][BF4] at the center changes alternately. Interestingly, anions and cations exhibit a significant asymmetric spatial distribution in CNT(12,12) and CNT(18,18), whereas a symmetrical distribution in CNT(16,16) and other CNTs. The asymmetric distribution is caused by the confined effects of some special carbon nanotubes on the anions and cations. The dynamical heterogeneity is also found in CNT(12,12) and CNT(18,18), which is closely related to the asymmetrical distribution of the structure properties. These novel simulation results could improve the understanding on the microstructure of the liquids including the ionic liquid in the confined space.