So I am planning a trip though Morocco for 10 days and I wanted to travel from Gibraltar to Marrakesh going through Casablanca. Thanks for any help or ideas.
that's pretty easy.
Train are clean nice and easy to use. Train stations are modern and cleanest place in whole Morocco with public wi-fi (not everywhere).
Mentioned in this answer:
Train is a very convinient way to link between important cities in Morocco (In most cases, it's better than taking couch).
I think you already visited the website of the Moroccan D-Bahn (ONCF.ma), so you can find time table. There is even an app (type ONCF on Playstore).
You can buy tickets from the website, and the prices does not fluctuate. 2nd Class Tickets are valid for the whole day, so don't worry if you miss your train.
Usualy trains comes with couch-like seats, but sometimes they put old trains with compartement for eight people.
I don't want to freak you out about security, but you should adopt the same attitude as in other countries : try to put important stuffs besides you, avoid void compartement, and most importantly avoid leaving your luggage or at least ask your neighbours to keep an eye on them.
Most of the train stations are located in dowtowns, so avoid taxis until it's necessary. If you have to take a taxi, avoid thoses parking just outside the train station - just walk 100m and catch one (make sure the driver put on the counter).
Have a nice trip.
My husband and I took the train from Marrakech to Fez a few years ago. Coming from the north into Marrakech, I believe you will have to go through Casablanca. It was not quick, but cheap and comfortable. When we compared the train vs airfare-it would have taken us the same amount of time-would have had to fly through Casablanca, and had a lay-over. We figured this way we could at least get a chance to see some country-side.