Appendix M in the Residential code covers decks, but other areas apply as well. Pg 915, figure AM111 is a good summary of the basics:
http://ecodes.biz/ecodes_support/fre...C_Res_2012.pdf
Note it includes both spacing, height, and horizontal loading requirements (you don't want to lean against the rail and have it break). Just about every manufactured railing system sold in the U.S. should be designed around these requirements and state that it meets them in their documentation and installation guidelines.
Horizontal rails are allowed but are a concern for some. I would consider horizontal cable rails better than solid because they're a bit wobbly to climb on. A small child is most likely to climb one or two then fall backward.
I'll also note that there are huge differences in the durability and quality of the various cable rail systems that are out there. The worst and cheapest are frequently a maintenance nightmare as the cables work their way out of the fittings over time. In general I avoid cable rail unless the client demands it.