It depends on the markup format, language, and libraries of course. However in general I prefer code. Why? While it takes a bit longer to get started, you can factor patterns into reusable methods and before you know it are working at a higher level:
make_fancy_dialog(msg);
Html only recently got templates but I don’t believe they are that powerful.