Adding Table format in the SendMail Component

One Star lkv
One Star

Adding Table format in the SendMail Component

How i can add a proper table format to display the content in SendMail. Below is my Job
 


Now the java flex has
         Start Code:
             String result_set="";
Main Code
result_set=result_set+"&nbsp;"+"&nbsp;"+"&nbsp;"+email_output.Name+"&nbsp;"+"&nbsp;"+"&nbsp;"+email_output.EmpID+"<p>";

End Code
      globalMap.put("result",result_set);



SendMail message has

(String)globalMap.get("result")

-Advance setting:   MIME type ='HTML'


I get output like below

eg:

---------------------------------------------------------------  Output -------------------------------------

Name           Number

Jhon   EMP00123
Daniel    EMP111111

-------------------------------------------------------------------------------------------------------------


This works, But you can see the column are not properly indent.

So how i can achieve the proper indent ?
Any help is greatly appreciated

My job desgin

Seventeen Stars

Re: Adding Table format in the SendMail Component

hi Ikv,
Why are you using tjavaflex for that ?
branch your flow directly to tSendmail or use flowToIterate (that put each field in globalMap)

regards
laurent
One Star lkv
One Star

Re: Adding Table format in the SendMail Component

I got this by adding below code in Java Flex
Start code

 String result_set="<style>table, td {    border: 1px solid black;    border-collapse: collapse;}table, th { border: 2px solid black;}th, td {padding: 3px;},th {text-align: left;},th {background-color: DodgerBlue; color: white;},td{font-family: arial; font-size: 10pt;}</style> <table style=width:100%><tr><th>Name</th><th>Number</th> </tr>" ;


End Code
          result_set=result_set+"</table>";
      globalMap.put("result",result_set);

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog