Skip to main content
Question

htmlreportgenerator and emailer


Forum|alt.badge.img

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

11 replies

Forum|alt.badge.img
  • Author
  • October 30, 2019

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


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • October 31, 2019

Hi @knfme2019,

Make sure the Table Style is set to bordered.


Forum|alt.badge.img
  • Author
  • October 31, 2019

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

 


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • October 31, 2019
knfme2019 wrote:

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....


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • October 31, 2019
knfme2019 wrote:

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.


Forum|alt.badge.img
  • Author
  • October 31, 2019

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?


Forum|alt.badge.img
  • Author
  • June 11, 2020
alex_apeldoorn wrote:

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


redgeographics
Celebrity
Forum|alt.badge.img+49

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. 


redgeographics
Celebrity
Forum|alt.badge.img+49
alex_apeldoorn wrote:

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>


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings