Agree with Prudie. Public transport pretty good, but you will have a much more flexible time of it with a hire car.
If you get the chance, visit the towns and cities in the province of Cadiz: Jerez de la Frontera, for the Sherry and wonderful fresh seafood, (its two 'sister' towns, Puerto de Santa Maria and Sanlucar de Barrameda form part of the Sherry triangle and are well worth a visit, as is Cadiz.). Gibraltar is an awful place, but worth popping on for an hour or so just to say you have been there.