# Are the sub-spectral types (1,…9) based on temperature or spectral lines?

The spectral type of stars has an OBAFGKM class, along with a number, from 0 to 9. According to Wikipedia, (sample shown below), the lower the number, the hotter and more massive the star, but absorption lines are not included. Then looking at the second image, we can see that different spectral types have different absorption lines. So I am wondering, are the sub-spectral types (numbers) based off of temperature and/or mass or absorption/spectral lines?