But the quran mentioned that earth was a smoke, why it needs to tell such fact which wasn't known
for the people of that era?
I never thought it did. Far as I can tell, it is only Muslim apologists who make such a claim.
Which does not impress me favorably, now that you mention it.
For one, depending on one's desire to cooperate with the text, the claim is either false or true only by taking a jumbo-sized artistical stretch. "Smoke" is by no means an accurate description of Earth's composition. It might be an useful descriptor to invoke an understanding of disperse stellar matter in the proper contexts, I suppose. Or perhaps of the subatomic nature of matter, with so much empty space. Maybe Muhammad simply noticed that since matter density varies so much it must have a variable amount of free room in its microscopic nature. Maybe he just liked the sound of saying it. Who knows?
He might have described Earth as a network, as a stone, as a ball, or as a fruit. Each comparison would have had its own merits and been true by its own perspective, often without quite so much need for artistic license. Even an entirely unworkable descriptor would simply be glossed over amidst so much ornate language, waiting patiently for the hypothetical day when someone finds some rough correspondence to it in other fields of knowledge.
As evidence for truth of the text goes, that just does not work at all.
Also, how do you even know that people of the time were lacking in physical or cosmological knowledge to the point of being unable of making such a comparison? You almost seem to believe that the Qur'an is not only a religious scripture, but a veritable cornucopia of previously unsuspected scientific knowledge. Which it plainly
wasn't, since so many of those supposed prophecies took so long to be "confirmed" - and even then only by using copious amounts of poetic license. It is plenty obvious that the people of the time did not particularly benefit on their scientific knowledge from the Qur'an, mainly because there is so little actual science to be found in it. Even today it is far from clear what that comparison was supposed to mean, which shows how little actual information it provides.
As a matter of fact, I am unaware of a single actual scientific innovation that was revealed by the Qur'an. It is entirely possible that there were some, or at least some items of practical advice that is now scientifically sound. But I would not count a claim that the Earth is made of smoke among them.