fork(11) download
  1. import groovy.xml.MarkupBuilder
  2. def hashmap = [Array1:['a','b','c'], Array2:[1,2,3]]
  3. StringWriter st = new StringWriter()
  4. def mkup = new MarkupBuilder(st)
  5. mkup.html {
  6. hashmap.collect{ k, vList ->
  7. table {
  8. vList.collect {tr it}
  9. }
  10. }
  11. }
  12. println st.toString()
Success #stdin #stdout 1.31s 89464KB
stdin
Standard input is empty
stdout
<html>
  <table>
    <tr>a</tr>
    <tr>b</tr>
    <tr>c</tr>
  </table>
  <table>
    <tr>1</tr>
    <tr>2</tr>
    <tr>3</tr>
  </table>
</html>