Html table alternative rows for tSendEmail

Five Stars

Html table alternative rows for tSendEmail

Hi,

I made a report which will be send through email, everything is working fine. The one small issue is design of html, below is my tJavaRow code, So for each alternative row i want to use different CSS class. 

I have two classes class='tg-yw4l' and class='tg-6k2t'. How can i do this, Please advise.

 

 

 

msg = msg+
 "<tr>" +
 "<td class='tg-6k2t'>" + input_row.Registeration_Date +  "</td>" +
 "<td class='tg-6k2t'>" + input_row.Outgoing_revenues + "</td>" +
 "<td class='tg-6k2t'>" + input_row.RGE + "</td>" +
 "<td class='tg-6k2t'>" + input_row.First_Recharge + "</td>" +
 "<td class='tg-6k2t'>" + input_row.ARPU + "</td>" +
 "</tr>";

 

 

Tags (1)

Accepted Solutions
Forteen Stars TRF
Forteen Stars

Re: Html table alternative rows for tSendEmail

As I understand, you search for a solution to apply 1 css class for odd rows and an other for even rows.
You may use a sequence to decide which css class must be used for the current row and store the name into a local String variable:

String cssClass;
if ((Numeric.sequence("s1",1,1) % 2) == 0)
cssClass = "tg-yw4l" ;
else
cssClass = "tg-6k2t" ;

Then you can use the cssClass variable when you construct the msg variable:
"<td class='"+cssClass+"'>" + input_row...

TRF

All Replies
Forteen Stars TRF
Forteen Stars

Re: Html table alternative rows for tSendEmail

As I understand, you search for a solution to apply 1 css class for odd rows and an other for even rows.
You may use a sequence to decide which css class must be used for the current row and store the name into a local String variable:

String cssClass;
if ((Numeric.sequence("s1",1,1) % 2) == 0)
cssClass = "tg-yw4l" ;
else
cssClass = "tg-6k2t" ;

Then you can use the cssClass variable when you construct the msg variable:
"<td class='"+cssClass+"'>" + input_row...

TRF
Five Stars

Re: Html table alternative rows for tSendEmail

Thank You, It works perfect.