Table Formatting in HTML

@arivu96 now it also shows an error that your string format is not correct.

Hi @kapildarmoda,

Can you send me the screenshot of what u have done?

Regards,
Arivu

Try this:

th:nth-child(2),
td:nth-child(2) {
    text-align: center;
}

Sample-JSFIDDLE

Regards…!!
Aksh

Main.xaml (22.9 KB)

didn’t work.

Hey @kapildarmoda

There was problem with your Html Conent. just learn about Html too :slight_smile:

tag should be close too like and end tag too

Find below sample reference for your better understanding -KapilSample.xaml (26.0 KB)

Regards…!!
Aksh

In your screenshot, column 2 is still left aligned. and when i use your code, it throws me an error ā€œstring format is not correctā€.

<table style=ā€œwidth:100%ā€>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>

@misha I want to format (text alignment) columns of table.

Hey @kapildarmoda

Have a look with this: KapilSample.xaml (26.0 KB)

image

Regards…!!
Aksh

Hi @aksh1yadav, thanks for your response. if I use your code then I need to remove assign activity and without that I can pass {0}. you can see in your screenshot.

@sarathi125 @arivu96 @aksh1yadav can you see whats the problem.

actual output: all table content left aligned
desired output: middle column content must be center aligned

if i use- th:nth-child(2),td:nth-child(2) {text-align: center;} it will give me error in assign activity.
if i use- th:nth-child(2),td:nth-child(2) {{text-align: center;}} it will make no change.

Main.xaml (22.9 KB)

@nimin

@lakshman can you please help.

@kapildarmoda,

You want center alignment for second column only right ? And also please send me your table data.

@lakshman yes, this time i want it for second column only. However, want to learn logic also, so that i can use it with multiple columns later.

Main.xaml (22.9 KB)
Feedback12345.xlsx (8.1 KB)

I used assign activity at the end so to pass dynamic name in each email.

@kapildarmoda,

Please find the attached File.

ExcelToMail.xaml (26.3 KB)

If you want text alignment for other columns then you can change here:
image

If you have any doubts then please let me know.

@lakshman it didn’t work. it has following problem:

  1. header color is not there
  2. dynamic name does not appear. it shows ā€œHi {0}ā€. if you delete assign activity.

@kapildarmoda,

I didn’t put any color for header.

I forgot to add this part. Take assign activity and use this syntax: body text.replace(ā€œ{0}ā€, ā€œRequiredNameā€)

table formatting in html can be done with the help
of ā€˜table’ tag and for adding any column you
can use ā€˜td’ tag and ā€˜th’ tag for rows.