Skip to main content

I don't see the grid in email body when I use table in htmlreportgenerator and emailer

try to show table in body of email. i see all information i need but no grids. would you help me out. thank you in advance


Hi @knfme2019,

Make sure the Table Style is set to bordered.


Thanks Itay. I did use bordered. I can see the grids if write to HTML format.

in this case, I would like to have in email.

I use emailer and body is html_content

 

this is html writer- which looks good

 


Thanks Itay. I did use bordered. I can see the grids if write to HTML format.

in this case, I would like to have in email.

I use emailer and body is html_content

 

this is html writer- which looks good

 

There is probably something happening when displaying the html in de mail, I am not sure there is much you can do about it....

You could send the table as a xls attachment....


Thanks Itay. I did use bordered. I can see the grids if write to HTML format.

in this case, I would like to have in email.

I use emailer and body is html_content

 

this is html writer- which looks good

 

And can you look at html_content in the Data Inspector or a text editor, to see if the border is being properly set? As Itay says, it may be a display issue in the email client.


yes, it' set to bordered. it also look good in Preview in Browser though. maybe in email client. thanks Mark


I have the same problem here.. it's set to bordered but in outlook it doesn't show the borders.

 

@knfme2019 did you ever find a solution to this problem?


I have the same problem here.. it's set to bordered but in outlook it doesn't show the borders.

 

@knfme2019 did you ever find a solution to this problem?

No, Alex! I have to do something else so never have time getting back to this matter


I've looked into this and found that if you set the table style to bordered in the HTMLReportGenerator it references an external CSS library:

<!DOCTYPE html>
<html>
   <head>
      <title>Test</title>
      <meta charset="UTF-8">
      <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
   </head>
   <body>
      <table class="table table-bordered">
         <thead>
            <tr>
               <th>Attribute1</th>
               <th>Attribute2</th>
               <th>Attribute3</th>
            </tr>

The thing is that most (all?) email clients don't allow external CSS.

So... if you want to be able to control this you can use a StringReplacer to replace that <table> tag like this:

0684Q00000ArLO8QAN.png

Alternatively you can use it to take out that <link...> tag and replace it with a <style></style> block containing your CSS, but you'd have to know CSS for that. And for full control you can ditch the HTMLReportGenerator entirely and code the whole thing using an XMLTemplater, using inline CSS. 


I have the same problem here.. it's set to bordered but in outlook it doesn't show the borders.

 

@knfme2019 did you ever find a solution to this problem? 

I've looked into this and found that if you set the table style to bordered in the HTMLReportGenerator it references an external CSS library:

<!DOCTYPE html>
<html>
   <head>
      <title>Test</title>
      <meta charset="UTF-8">
      <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
   </head>
   <body>
      <table class="table table-bordered">
         <thead>
            <tr>
               <th>Attribute1</th>
               <th>Attribute2</th>
               <th>Attribute3</th>
            </tr>

The thing is that most (all?) email clients don't allow external CSS.

So... if you want to be able to control this you can use a StringReplacer to replace that <table> tag like this:

0684Q00000ArMjfQAF.png

Alternatively you can use it to take out that <link...> tag and replace it with a <style></style> block containing your CSS, but you'd have to know CSS for that. And for full control you can ditch the HTMLReportGenerator entirely and code the whole thing using an XMLTemplater, using inline CSS. 


A workaround for this issue, is to insert the style yourself in as CustomHTML element within the HTMLReportGenerator

for instance:

<style>

th {

  font-weight:bold;

  color:#ffffff;

  background-color:#009530;

  cursor:pointer;

}

td {

  font-weight:normal;

  color:black;

  border: 1px solid black;

}

</style>


Reply