Search code examples
freemarker

FTL: How to make a table like structure in ftl language?


Trying to make a table like structure..

Name Age abc 9 pqr 14

I am not able to indent it properly in tabular form. My code structure is:

Name                          Age 
<#list (model.names) as  myname>    
${myname.name}    ${myname.age}


Solution

  • Are you generating plain text? Then things like ${foo?right_pad(20)} can help (http://freemarker.org/docs/ref_builtins_string.html#ref_builtin_right_pad).