How to color the table format using HTML in Talend

Six Stars

How to color the table format using HTML in Talend

How to color the DB_Filename (i.e) Highlighted one should be in color using HTML.

 

This is the HTML code for the below output.

//Code generated according to input schema and output schema
context.File_Location = input_row.A;
context.Duplicate_Files = input_row.B;
context.Last_Modified_date = input_row.C;
context.DB_FileName = input_row.D;


String msg = ((String)globalMap.getOrDefault("mailMsg", "<body> <table border=\"1\"><tr><th>File_Location</th><th>Duplicate_Files</th><th>Last_Modified_date</th><th>DB_FileName</th></tr>"));
msg = msg +
"<tr><td>" + context.File_Location + "</td>" +
"<td>" + context.Duplicate_Files + "</td>" +
"<td>" + context.Last_Modified_date + "</td>" +
"<td>" + context.DB_FileName + "</td></tr>";

globalMap.put("mailMsg", msg);

 

a.JPGb.JPG

Highlighted
Sixteen Stars
Sixteen Stars

Re: How to color the table format using HTML in Talend

You may try this one:

"<td>" + context.Last_Modified_date + "</td>" +
"<td><span style=\"color: #ffff00;\">" + context.DB_FileName + "</span></td></tr>";

 


TRF

2019 GARTNER 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

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