I want to generate an email including some table data and use PLQL to send this to company members. So far I am using some HTML templates and Oracles UTL_mail. I did send emails to a Gmail web interface and to Outlook. As the style seems okay in Gmail, I guess that it is an Outlook issue. I am a complete beginner when it comes to HTML and I am open to any suggestions and workarounds so that the table looks somewhat smooth for Outlook, too.
Below Code will not show any border for Outlook but it does for Gmail and within the W3School-Try-It editor.
utl_mail.send(sender => 'noreply@mycompany.de'
, recipients => 'me@gmail.com,me@mycompany.de'
, subject => 'Test Table'
, message =>
'<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>Oracle Table</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
padding: 2em;
}
table.table {
width: 80%;
}
.table th {
text-align: left;
}
table, th, td {
border: 1px solid rgba(3,3,3,0.2);
border-collapse: collapse;
}
th.zelle {
text-align: left;
padding-right: 2rem;
}
td.zelle {
text-align: right;
padding-left: 1rem;
}
img {
width: 200px
}
@media screen and (max-width: 1200px) {
body {
font-size: 150%;
}
table {
width: 100%;
}
table.table {
width: 60%;
font-size: 100%;
}
tr {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin: 0.5em 0;
border: 1px solid rgba(3,3,3,0.2);
border-collapse: collapse;
}
td, th {
flex: 1 1 150px;
border-collapse: collapse;
}
th.zelle {
text-align: left;
padding-right: 1rem;
}
td.zelle {
text-align: right;
padding-left: 1rem;
}
}
</style>
</head> <body> <p> This is a table</p> <br>
<table class="table">
<tr>
<th class="zelle"> Name </th> <th class="zelle"> Sal </th> <th class="zelle"> Dep </th> </tr>
<tr> <td class="zelle"> Smith </td> <td class="zelle"> 3k </td> <td class="zelle"> 12 </td> </tr>
<tr> <td class="zelle"> Miller </td> <td class="zelle"> 3k </td> <td class="zelle"> 10 </td> </tr>
<tr> <td class="zelle"> Johnsen </td> <td class="zelle"> 5k </td> <td class="zelle"> 29 </td> </tr>
</table>
<section>
<p> Best regards, <br> Peter</p>
</section>
</body>
</html>
'
, mime_type => 'text/HTML; charset= utf-8'
);