You asked:

was dakota fanning in the movie the cat in the hat

Yes. Dakota Fanning is a cast member of The Cat in the Hat.
Dakota Fanning
Dakota Fanning
Dakota Fanning

The Cat in the Hat