I noticed writers in the past used a different format, in terms of punctuation, indentation, quotations, spacing, and paragraph length, and the format can be different from author to author and from book to book. So I was wondering if there was a sort of resource book that details all the styles people adopted. The reason I want a book like this is that it can really be fun to change your formatting style and writing style.
I haven't been able to find a book, per se, but I have found a couple of resources that might work for your other request be being able to adopt someone else's writing style. I did a Google search on: "history of" "writing styles"; "history of" "writing styles" book.
Here are some of the results that seem to fit your wishes best.
A writer’s most prized possession is his or her own unique writing style.
Famous Authors and Their Writing Styles
How have authors' writing styles changed in the last few centuries?
The Quora page has links to similar questions, so maybe you can find something there.
The only books I could find were about writing materials, history of languages, type of communication (including animal communication), and nothing that remotely came close to describing the how/why Shakespeare is different than J. K. Rowling, let alone how to duplicate the styles.
It seems to me this would be an obvious book to have written, since it's a book about writers for writers, yet I can't find it, nor can the 70+ other people who looked at this question. I'm not a writer, but I do a lot of online research, so I thought I would be able to come up with something better.
I know a couple of writers, so I'll ask them offline and see if they know of anything. If they do, I'll update this answer.
I got some hits from the writers I know.
"Writer's Guide: History", By Henry J. Steffen and Mary Jane Dickerson
"On Writing", by Stephen King
Disclaimer: I haven't read either book, so I don't know if it's what you're looking for. Links provided only for further context, not purchase or retailer suggestions.