Classroom-based TEFL courses
There are two leaders in EFL teaching in Europe - the Cambridge CELTA and the Trinity TESOL course. They are both well recognized. Even if a school specifies "CELTA required", they will still accept the Trinity course ('CELTA' is industry shorthand for 'respected TEFL course').
The most important thing about the TEFL course is the classroom practice. This gives you the confidence to stand in front of a classroom of students and gives you the opportunity to learn from your mistakes.
Classroom-based TEFL courses are also often extremely expensive. They also take up at least a month of your time, during which you will not be earning. I had to save up a long time to do my course. Do I think it was worth it? As a magic key to getting work teaching English in Spain - yes. But for course content - no.
Online TEFL courses
Online TEFL courses are cheap alternatives to a classroom-based course.
Online TEFL courses miss out one vital element - classroom practice. The other problem is that schools in Spain won't take them seriously.
Most of the information you get from an online TEFL course can be found in books on Teaching English as a Foreign Language, which will give you the same information, albeit without any assessment.
However, if you know you won't do the TEFL course but you want some kind of structured learning and assessment, then an online course could be right for you. But do it for yourself, because you really want to learn something from it, not for recognition from schools.
Mixed Online & Classroom TEFL courses
This could be a happy medium between the previous two options. The only company I know that does this is i-to-i. You do the online course in your own time and then do a weekend course to finish off with some one-to-one tuition and classroom experience. You can do these courses in the USA, the UK, Ireland, Spain and other countries.