Thank you for giving me the floor. vs Thank you to give me the floor.
Are they both correct? If yes, Are they have same meaning?
Thank you for x-ing ... is idiomatic.
Thank you to x ... is not.
But I'll thank you to x ... is grammatical, and is an idiom meaning something like "I demand that you do this, but I'm pretending that I'm being polite".
As far as I know, there is no explanation for this: it's just the way English works.