The following code should count the paragraphs and in each paragraph the function placeComponents uses a patter to determine whether the paragraph contains a certain text. (It's actually more complicated but this summarizes what the code does.)
await window.Word.run(async context => {
const paragraphs = context.document.body.paragraphs
context.load(paragraphs, 'text,tableNestingLevel,contentControls/title')
await context.sync()
let emptyParagraphTable = 0
for (let i = 0; i < paragraphs.items.length; i++) {
console.log('Is the paragrap in table?', paragraphs.items[i].tableNestingLevel !== 0, i, paragraphs.items[i].text)
if (paragraphs.items[i].tableNestingLevel !== 0 && paragraphs.items[i].text === '') {
emptyParagraphTable += 1
} else {
const id = i - emptyParagraphTable
await placeComponents(paragraphs.items[i], id)
}
}
})
The document content looks like this
and the code log:
As you can see, some cells that not appear in the table are recognized as paragraphs. So I count them.
But if I export the word doc to html the "empty" paragraphs not appear (as you can see into the next html code). So I try to search but <p> by order it not possible to do correctly:
<tr>
<td width=154 valign=top style='width:115.4pt;border:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt'>
<p class=111 style='margin-left:0cm;text-indent:0cm'><span lang=EN-US>NAME</span></p>
</td>
<td width=161 colspan=3 valign=top
style='width:121.05pt;border:solid windowtext 1.0pt; border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p class=111 style='margin-left:0cm;text-indent:0cm'><span lang=EN-US>SURNAME</span></p>
</td>
<td width=145 valign=top
style='width:108.75pt;border:solid windowtext 1.0pt; border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p class=111 style='margin-left:0cm;text-indent:0cm'><span lang=EN-US>AGE</span></p>
</td>
</tr>
<tr style='height:12.5pt'>
<td width=154 rowspan=2 valign=top
style='width:115.4pt;border:solid windowtext 1.0pt; border-top:none;padding:0cm 5.4pt 0cm 5.4pt;height:12.5pt'>
<p class=111 style='margin-left:0cm;text-indent:0cm'><span lang=EN-US>Francho</span></p>
</td>
<td width=81 rowspan=2 valign=top
style='width:60.5pt;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt;height:12.5pt'>
<p class=111 style='margin-left:0cm;text-indent:0cm'><span lang=EN-US>García</span></p>
</td>
<td width=81 colspan=2 valign=top
style='width:60.55pt;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt;height:12.5pt'>
<p class=111 style='margin-left:0cm;text-indent:0cm'><span lang=EN-US>Villarroya</span></p>
</td>
<td width=145 rowspan=2 valign=top
style='width:108.75pt;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt;height:12.5pt'>
<p class=111 style='margin-left:0cm;text-indent:0cm'><span lang=EN-US>40</span></p>
</td>
</tr>
<tr style='height:12.5pt'>
<td width=40 valign=top
style='width:30.25pt;border-top:none;border-left: none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt;height:12.5pt'>
<p class=111 style='margin-left:0cm;text-indent:0cm'><span lang=EN-US>Juan</span></p>
</td>
<td width=40 valign=top
style='width:30.3pt;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt;height:12.5pt'>
<p class=111 style='margin-left:0cm;text-indent:0cm'><span lang=EN-US>Berna</span></p>
</td>
</tr>
<tr>
<td width=154 valign=top
style='width:115.4pt;border:solid windowtext 1.0pt; border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p class=111 style='margin-left:0cm;text-indent:0cm'><span lang=EN-US>____</span></p>
</td>
<td width=161 colspan=3 valign=top
style='width:121.05pt;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt'>
<p class=111 style='margin-left:0cm;text-indent:0cm'><span lang=EN-US> </span></p>
</td>
<td width=145 valign=top
style='width:108.75pt;border-top:none;border-left: none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt'>
<p class=111 style='margin-left:0cm;text-indent:0cm'><span lang=EN-US>_____ /_____</span></p>
</td>
</tr>
How can I skip the "empty" cells? How can I pick out them between the correct cells?
Related
my problem is that after sending template mail/ saving template in chrome
e.g. to myself, when I opens it, it looks good, but after a few seconds it looks like it is loosing some css (in this particular case it is loosing borders in bottom table).
Here is the code, it was written in MJML
What is weird, if i send this template not through gmail it looks good even in gmail
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title>
</title>
<!--[if !mso]> -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
#outlook a {
padding: 0;
}
.ReadMsgBody {
width: 100%;
}
.ExternalClass {
width: 100%;
}
.ExternalClass * {
line-height: 100%;
}
body {
margin: 0;
padding: 0;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
table,
td {
border-collapse: collapse;
mso-table-lspace: 0pt;
mso-table-rspace: 0pt;
}
img {
border: 0;
height: auto;
line-height: 100%;
outline: none;
text-decoration: none;
-ms-interpolation-mode: bicubic;
}
p {
display: block;
margin: 13px 0;
}
</style>
<!--[if !mso]><!-->
<style type="text/css">
#media only screen and (max-width:480px) {
#-ms-viewport {
width: 320px;
}
#viewport {
width: 320px;
}
}
</style>
<!--<![endif]-->
<!--[if mso]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if lte mso 11]>
<style type="text/css">
.outlook-group-fix { width:100% !important; }
</style>
<![endif]-->
<!--[if !mso]><!-->
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet" type="text/css">
<style type="text/css">
#import url(https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700);
</style>
<!--<![endif]-->
<style type="text/css">
#media only screen and (min-width:480px) {
.mj-column-per-100 {
width: 100% !important;
}
.mj-column-px-300 {
width: 300px !important;
}
.mj-column-per-50 {
width: 50% !important;
}
}
</style>
<style type="text/css">
</style>
</head>
<body>
<div>
<div class="mj-column-per-100 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
<tr>
<td align="center" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<div style="font-family:verdana;font-size:20px;line-height:1;text-align:center;color:black;">
Tytul
</div>
</td>
</tr>
<tr>
<td vertical-align="top" style="font-size:0px;padding:20px 0;word-break:break-word;">
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
<tbody>
<tr>
<td>
<!--[if mso | IE]>
<table
align="center" border="0" cellpadding="0" cellspacing="0" style="width:600px;" width="600"
>
<tr>
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
<![endif]-->
<div style="Margin:0px auto;max-width:600px;">
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
<tbody>
<tr>
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td
style="vertical-align:top;width:300px;"
>
<![endif]-->
<div class="mj-column-px-300 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<table 0="[object Object]" 1="[object Object]" 2="[object Object]" border="0" style="cellspacing:0;color:#000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;table-layout:auto;width:100%;">
<tr style="text-align: left;">
<th>
<h3>Desktop</h3>
</th>
</tr>
<tr style="text-align: left;">
<th style="padding: 5px;">TAG</th>
<th style="padding: 5px;">STATUS</th>
</tr>
<tr style="text-align: left; background-color: #e0ecff;">
<td style="padding: 5px;">Homepage</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left;">
<td style="padding: 5px;">Category</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left; background-color: #e0ecff;">
<td style="padding: 5px;">Search</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left;">
<td style="padding: 5px;">Offer</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left; background-color: #e0ecff;">
<td style="padding: 5px;">Basket</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left;">
<td style="padding: 5px;">StartOrder</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left; background-color: #e0ecff;">
<td style="padding: 5px;">Confirmation</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left;">
<td style="padding: 5px;">Placebo</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr style="text-align: left; background-color: #e0ecff;">
<td>Comment:</td>
<td></td>
</tr>
<tr>
<td>Comment here</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!--[if mso | IE]>
</td>
<td
style="vertical-align:top;width:300px;"
>
<![endif]-->
<div class="mj-column-px-300 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<table 0="[object Object]" 1="[object Object]" 2="[object Object]" border="0" style="cellspacing:0;color:#000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;table-layout:auto;width:100%;">
<tr style="text-align: left;">
<th>
<h3>Mobile</h3>
</th>
</tr>
<tr style="text-align: left;">
<th style="padding: 5px;">TAG</th>
<th style="padding: 5px;">STATUS</th>
</tr>
<tr style="text-align: left; background-color: #e0ecff;">
<td style="padding: 5px;">Homepage</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left;">
<td style="padding: 5px;">Category</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left; background-color: #e0ecff;">
<td style="padding: 5px;">Search</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left;">
<td style="padding: 5px;">Offer</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left; background-color: #e0ecff;">
<td style="padding: 5px;">Basket</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left;">
<td style="padding: 5px;">StartOrder</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left; background-color: #e0ecff;">
<td style="padding: 5px;">Confirmation</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr style="text-align: left;">
<td style="padding: 5px;">Placebo</td>
<td style="padding: 5px;">OK</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr style="text-align: left; background-color: #e0ecff;">
<td>Comment:</td>
<td></td>
</tr>
<tr>
<td>Comment here</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!--[if mso | IE]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td vertical-align="top" style="font-size:0px;padding:20px 0;word-break:break-word;">
<!--[if mso | IE]>
<table
align="center" border="0" cellpadding="0" cellspacing="0" style="width:600px;" width="600"
>
<tr>
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
<![endif]-->
<div style="Margin:0px auto;max-width:600px;">
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
<tbody>
<tr>
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;vertical-align:top;">
<!--[if mso | IE]>
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
<tr>
<td
style="vertical-align:top;width:300px;"
>
<![endif]-->
<div class="mj-column-per-50 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<table 0="[object Object]" 1="[object Object]" 2="[object Object]" border="0" style="cellspacing:0;color:#000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;table-layout:auto;width:100%;">
<tr style="text-align: left; border-bottom: 1px solid black;">
<td style="padding: 5px; width: 82px;">Rate card:</td>
<td style="padding: 5px;">RC here</td>
</tr>
<tr style="text-align: left;">
<td style="padding: 5px; width: 82px; ">Budget:</td>
<td style="padding: 5px;">text</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!--[if mso | IE]>
</td>
<td
style="vertical-align:top;width:300px;"
>
<![endif]-->
<div class="mj-column-per-50 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<table 0="[object Object]" 1="[object Object]" 2="[object Object]" border="0" style="cellspacing:0;color:#000;font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;table-layout:auto;width:100%;">
<tr style="text-align: left; border-bottom: 1px solid black;">
<td style="padding: 5px; width: 82px;">Optimization:</td>
<td style="padding: 5px;">text</td>
</tr>
<tr style="text-align: left;">
<td style="padding: 5px; width: 82px;">Banners:</td>
<td style="padding: 5px;">text</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!--[if mso | IE]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
Try to sent via another method. Im using Litmus, its working fine or just try to sent via mailjet - i think it should work either and its for free.
You code seems to be correct (checked via https://www.w3schools.com/Html/tryit.asp?filename=tryhtml_form_mail )
Small 1px gap appears below table containing content on the left. This only appears in Outlook 2016 (Windows).
Had tried adding border-collapse:collapse, margin:0 and padding:0 but to no avail. Anyone else experienced this or dealt with it?
<table cellspacing="0" cellpadding="0" border="0" width="600">
<tr>
<td align="center" valign="top">
<table cellspacing="0" cellpadding="0" border="0" width="100%" class="" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color:#FFFFFF;">
<tr>
<td style="padding:0px 20px;">
<table cellspacing="0" cellpadding="0" border="0" width="100%" class="" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color:#3498db; border-radius:10px;">
<tr>
<!-- info -->
<th style="font-weight:normal; text-align:left;">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="45"></td>
<td><table cellspacing="0" cellpadding="0" border="0" align="right">
<tr>
<td style="color:#FAFAFA; font-family: Arial; font-size:12px; line-height:14px;">Android</td>
</tr>
<tr>
<td width="" height="5" bgcolor="" style="mso-line-height-rule: exactly; line-height: 5px;"><!--[if gte mso 15]> <![endif]--></td>
</tr>
<tr>
<td style="color:#FAFAFA; font-family: Arial; font-size:16px; line-height:18px; font-weight:bold;">Lorem ipsum dolor sit.</td>
</tr>
<tr>
<td width="" height="10" bgcolor="" style="mso-line-height-rule: exactly; line-height: 10px;"><!--[if gte mso 15]> <![endif]--></td>
</tr>
<tr>
<td style="color:#FAFAFA; font-family: Arial; font-size:14px; line-height:16px;">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Veniam, temporibus, quis voluptatum iure recusandae amet.</td>
</tr>
</table></td>
</tr>
</table>
</th>
<!-- image -->
<th style="font-weight:normal;"><table cellspacing="0" cellpadding="0" border="0" width="245">
<tr>
<td style="padding:15px 45px 15px 0px;" align="left"><img src="http://placehold.it/200x200?text=" alt="" width="200" border="0" style="display:block;" class=""></td>
</tr>
</table></th>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
It actually wasn't a table issue, it was your TH. This is a known bug for outlook 2016. (https://mosaico.io/email-client-tricks/outlook-2016-weird-1px-horizontal-lines/)
To solve it, any TH or TD that is causing this just needs to have 'overflow:hidden' in the inline style and it should make this line disappear.
<table cellspacing="0" cellpadding="0" border="0" width="600">
<tr>
<td align="center" valign="top">
<table cellspacing="0" cellpadding="0" border="0" width="100%" class="" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color:#FFFFFF;">
<tr>
<td style="padding:0px 20px;">
<table align="left" cellspacing="0" cellpadding="0" border="0" width="100%" class="" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color:#3498db; border-radius:10px;">
<tr>
<!-- info -->
<th style="font-weight:normal; text-align:left; overflow:hidden;">
<table align="left" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="45"></td>
<td><table cellspacing="0" cellpadding="0" border="0" align="right">
<tr>
<td style="color:#FAFAFA; font-family: Arial; font-size:12px; line-height:14px;">Android</td>
</tr>
<tr>
<td width="" height="5" bgcolor="" style="mso-line-height-rule: exactly; line-height: 5px;"><!--[if gte mso 15]> <![endif]--></td>
</tr>
<tr>
<td style="color:#FAFAFA; font-family: Arial; font-size:16px; line-height:18px; font-weight:bold;">Lorem ipsum dolor sit.</td>
</tr>
<tr>
<td width="" height="10" bgcolor="" style="mso-line-height-rule: exactly; line-height: 10px;"><!--[if gte mso 15]> <![endif]--></td>
</tr>
<tr>
<td style="color:#FAFAFA; font-family: Arial; font-size:14px; line-height:16px;">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Veniam, temporibus, quis voluptatum iure recusandae amet.</td>
</tr>
</table></td>
</tr>
</table>
</th>
<!-- image -->
<th style="font-weight:normal;"><table cellspacing="0" cellpadding="0" border="0" width="245">
<tr>
<td style="padding:15px 45px 15px 0px;" align="left"><img src="http://placehold.it/200x200?text=" alt="" width="200" border="0" style="display:block;" class=""></td>
</tr>
</table></th>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
Per Campaign Monitor, Outlook (versions 2007-16) does not support the Overflow property.
Source: https://www.campaignmonitor.com/css/positioning-display/overflow/
After upgrading from 1.8 to 1.9.1 the font-size of my order emails is changed for the block totals and I can't figure out how to change it.
At the moment it looks like this: http://www.pic-upload.de/view-26791263/Unbenannt.jpg.html
I would like to change the font-sie to 12px like the rest of the email text.
Here my template from the backend:
<h1></h1>
<style type="text/css">
<!--
.Stil1 {
font-size: 12px;
font-weight: bold;
}
.Stil2 {font-size: 12px}
.Stil4 {font-size: 10px}
-->
</style>
<body style="background:#FFFFFF; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<footer style="background:#FFFFFF; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<div style="background:#FFFFFF; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td align="center" valign="top" style="padding:20px 0 20px 0">
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
<!-- [ header starts here] -->
<tr>
<td valign="top" bgcolor="#FFFFFF"><div align="right">
<p><img src="{{skin url="images/logo.jpg" _area='frontend'}}" alt="{{var store.getFrontendName()}}" style="margin-bottom:10px;" border="0"/>
</p>
<p>Shop Name <span class="Stil4">Shop Adress </span></p>
</div></td>
</tr>
<!-- [ middle starts here] -->
<tr>
<td valign="top" bgcolor="#FFFFFF">
<h1 class="Stil2" style="font-size:12px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Sehr geehrte Kundin, sehr geehrter Kunde, </h1>
<p class="Stil2">Vielen Dank für Ihre Bestellung. <br>
Die Bearbeitung Ihrer Bestellung sollte innerhalb der nächsten 5-7 Tage erfolgen. Sollten Sie dann nicht von uns hören, oder keine Ware erhalten, möchten wir Sie bitten, sich mit uns in Verbindung zu setzen. </p>
<span class="Stil2">Vielen Dank, <br>
Ihr Team </span>
<p style="font-size:12px; line-height:16px; margin:0;"> </p>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<h2 style="font-size:18px; font-weight:normal; margin:0;"><span class="Stil1">Ihre Bestellung #{{var order.increment_id}} <small>(getätigt am {{var order.getCreatedAtFormated('long')}})</small></span></h2> </td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<table cellspacing="0" cellpadding="0" border="0" width="650">
<thead>
<tr>
<th align="left" width="325" bgcolor="#FFFFFF" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;"><span class="Stil2"> Rechnungsadresse:</span></th>
<th width="10"></th>
<th align="left" width="325" bgcolor="#FFFFFF" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;"><span class="Stil2">Zahlart:</span></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA; border-top:1px solid #EAEAEA;">
{{var order.getBillingAddress().format('html')}} <br>
{{htmlescape var=$order.getCustomerEmail()}} </td>
<td> </td>
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA; border-top:1px solid #EAEAEA;">
{{var payment_html}}{{var order.customer_taxvat}} </td>
</tr>
</tbody>
</table>
<br/>
{{depend order.getIsNotVirtual()}}
<table cellspacing="0" cellpadding="0" border="0" width="650">
<thead>
<tr>
<th align="left" width="325" bgcolor="#FFFFFF" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;"><span class="Stil2">Lieferadresse:</span></th>
<th width="10"></th>
<th align="left" width="325" bgcolor="#FFFFFF" style="font-size:13px; padding:5px 9px 6px 9px; line-height:1em;"><span class="Stil2">Porto:</span></th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA; border-top:1px solid #EAEAEA;">
{{var order.getShippingAddress().format('html')}}
</td>
<td> </td>
<td valign="top" style="font-size:12px; padding:7px 9px 9px 9px; border-left:1px solid #EAEAEA; border-bottom:1px solid #EAEAEA; border-right:1px solid #EAEAEA; border-top:1px solid #EAEAEA;">Shipping Fees </td>
</tr>
</tbody>
</table>
<br/>
{{/depend}}
{{layout handle="sales_email_order_items" order=$order}} <br>
<span class="Stil2">Bestellkommentar:</span>
<p style="font-size:12px; margin:0 0 10px 0">{{var order.getEmailCustomerNote()}}</p> </td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
and template style:
body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
this worked well before but now the size of the totals block is much bigger. Can anyone suggest me where to add the correct tag to edit the font-size?
Try adding styles to the following template:
/app/design/frontend/**base/default**/template/sales/order/totals.phtml
or check the same file to your custom theme.
Try setting the font size on your local.xml. eg:
<sales_email_order_items>
<reference name="order_totals">
<action method="setLabelProperties"><value>style="padding:6px 9px;font-size:12px;"</value></action>
<action method="setValueProperties"><value>style="padding:6px 9px;font-size:12px;"</value></action>
</reference>
</sales_email_order_items>
I am creating report in Odoo using qweb template, while I am editing the paper format, I am not getting the desired view.
Here is my code.
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<template id="leave_card_report_temp">
<!-- <t t-call="report.html_container">-->
<!-- <t t-foreach="docs" t-as="doc">-->
<t t-call="report.external_layout">
<div class="page" style="width:860px;">
<!--<img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height:60px;align:left"/>-->
<h3><p style="text-center;">Leave Card</p></h3>
<br/>
<style>
table, th, td {
border: 2px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
text-align: left;
}
</style>
<table style="width:860px;font-Size:11px; border:1px solid black;border-collapse:collapse;border-bottom:1px solid white;">
<!-- <t t-foreach="docs" t-as="doc">-->
<!-- <t t-if="o.name">-->
<tr>
<td><strong>Name:</strong></td>
<td>
<!-- <span t-field="doc.name"/>-->
</td>
<td><strong>Designation:</strong></td>
<!-- <td><span t-field="designation"/></td>-->
<td><strong>Department:</strong></td>
<!-- <td><span t-field="department"/></td>-->
<td><strong>Employee Code:</strong></td>
<!-- <td><span t-field="name"/></td>-->
</tr>
<tr>
<td><strong>DOJ(C):</strong></td><td></td>
<td><strong>DOJ(R):</strong></td><td></td>
</tr>
<!-- </t> -->
</table>
<br/>
<br/>
<table cellspacing="1" cellpadding="4" border="3" class = "table table-striped">
<!--<table style="width:860px;font-Size:11px; border:1px solid black;border-collapse:collapse;border-bottom:1px solid white;">-->
<tr>
<th width="70" rowspan="2" >DATE FROM</th>
<th width="70" rowspan="2" >DATE TO</th>
<th width="70" rowspan="2" >No Of Days</th>
<th colspan="3"> CL</th>
<th colspan="4"> EL</th>
<th width="70" rowspan="2">LOP</th>
<th colspan="2">INITIALS</th>
<th width="70" rowspan="2"> REMARKS</th>
</tr>
<tr align="right">
<th width="70">Earned</th>
<th width="70">Availed</th>
<th width="70">Balance</th>
<th width="70">Earned</th>
<th width="70">Availed</th>
<th width="70">Balance</th>
<th width="70">Encashment</th>
<th width="70">Reporting Officer</th>
<th width="70">Reviewing Officer</th>
</tr>
<tbody>
<t t-foreach = "docs" t-as = "doc">
<tr>
<td><span t-field="doc.date_from"/></td>
<td><span t-field="doc.date_to"/></td>
<td><span t-field="doc.no_of_days"/></td>
<td><span t-field = "doc.earned_cl"/></td>
<td><span t-field = "doc.availed_cl"/></td>
<td><span t-field = "doc.balance_cl"/></td>
<td><span t-field = "doc.earned_el"/></td>
<td><span t-field = "doc.availed_el"/></td>
<td><span t-field = "doc.balance_el"/></td>
<td><span t-field = "doc.encash"/></td>
<td><span t-field = "doc.loss_of_pay"/></td>
<td><span t-field = "doc.reporting_officer"/></td>
<td><span t-field = "doc.reviewing_officer"/></td>
<td><span t-field = "doc.remark"/></td>
</tr>
</t>
</tbody>
</table>
</div>
</t>
<!-- </t>-->
<!-- </t>-->
</template>
<template id="leave_card_view">
<t t-call="report.html_container">
<t t-foreach="doc_ids" t-as="doc_id">
<t t-raw="translate_doc(doc_id, doc_model, 'leaves_management.leave_card_report_temp')"/>
</t>
</t>
</template>
</data>
</openerp>
My problem is, When I try to print a report, I am getting multiple documents. In my first table, if I assign the value doc.name, its create problem
I like to have multiple records in my second table but in the case of my first it should display ones.
First You should put the docs object in global ones in whole the template ran-daring in QWeb Report like this..
<template id="leave_card_report_temp">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="doc">
And access the doc in multiple table in ODOO
<table>
<tr>
<td>
<t t-if="doc.name>
<span t-field="doc.name"/>
</t>
</td>
</tr>
</table>
<table>
<tr>
<td>
<t-if="doc.date_from">
<span t-field="doc.date_from"/>
</t>
</td>
<td>
<t-if="doc.date_to">
<span t-field="doc.date_to"/>
</t>
</td>
<td>
<t-if="doc.no_of_days">
<span t-field="doc.no_of_days"/>
</t>
</td>
</tr>
</table>
</t>
</t>
</template>
This may helpful for you
I have the html structure below and I'm trying to select the row containing the text 'Related list item:'.
My Jquery is below:
$('#WebPartWPQ3 > table(eq:2) > tbody > tr > td > table > tbody > tr:last').remove();
but not working...
<DIV id="WebPartWPQ3" fixed_bound allowDelete="false" OnlyForMePart="true" HasPers="true" WebPartID="00000000-0000-0000-0000-000000000000" width="100%">
<TABLE cellSpacing="0" cellPadding="4" width="100%" border="0" fixed_bound xmlns:ddwrt2="urn:frontpage:internal" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema">
<TBODY fixed_bound>
<TR fixed_bound>
<TD class="ms-vb" fixed_bound>
</TD>
</TR>
</TBODY>
</TABLE>
<TABLE width="100%" border="0" fixed_bound xmlns:ddwrt2="urn:frontpage:internal" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema">
<TBODY fixed_bound>
<TR fixed_bound>
<TD fixed_bound>
<TABLE cellSpacing="0" width="100%" border="0" fixed_bound>
<TBODY fixed_bound>
<TR fixed_bound>
<TD class="ms-formlabel" vAlign="top" noWrap width="25%" fixed_bound>
<B fixed_bound>Title:
</B>
</TD>
<TD class="ms-formbody" vAlign="top" width="75%" fixed_bound>Employee annual leave approval
<BR fixed_bound/>
<BR fixed_bound/>
</TD>
</TR>
<TR fixed_bound>
<TD class="ms-formlabel" width="25%" fixed_bound>
<B fixed_bound>Approved Carry Forward days
<SPAN class="ms-formvalidation" fixed_bound> *
</SPAN>:
</B>
</TD>
<TD class="ms-formbody" width="75%" fixed_bound>
<SPAN fixed_bound>
<INPUT class="ms-input" id="ctl00_PlaceHolderMain_TaskForm_ff1_1_ctl00_ctl00_TextField" title="Approved Carry Forward days" style="IME-MODE: inactive" size="11" name="ctl00$PlaceHolderMain$TaskForm$ff1_1$ctl00$ctl00$TextField" fixed_bound value=""/>
<BR fixed_bound/>
</SPAN>
</TD>
</TR>
<TR fixed_bound>
<TD class="ms-formlabel" width="25%" fixed_bound>
<B fixed_bound>Review Comments:
</B>
</TD>
<TD class="ms-formbody" width="75%" fixed_bound>
<SPAN fixed_bound>
<TEXTAREA class="ms-long" id="ctl00_PlaceHolderMain_TaskForm_ff2_1_ctl00_ctl00_TextField" title="Review Comments" name="ctl00$PlaceHolderMain$TaskForm$ff2_1$ctl00$ctl00$TextField" rows="5" fixed_bound>
</TEXTAREA>
<BR fixed_bound/>
</SPAN>
</TD>
</TR>
<TR fixed_bound>
<TD class="ms-formlabel" vAlign="top" noWrap width="25%" fixed_bound>
<B fixed_bound>Related list item:
</B>
</TD>
<TD class="ms-formbody" vAlign="top" width="75%" fixed_bound>
<A href="http://orange.extra.net/people/hr/Workflows/Expire%20the%20employee%20year%20in%20a%20year/" fixed_bound>
</A>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
<TABLE cellSpacing="0" cellPadding="4" width="100%" border="0" fixed_bound xmlns:ddwrt2="urn:frontpage:internal" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema">
<TBODY fixed_bound>
<TR fixed_bound>
<TD class="ms-vb" noWrap fixed_bound>
<INPUT style="DISPLAY: none" onclick="javascript: __doPostBack('ctl00$PlaceHolderMain$TaskForm','__update;__commit;__redirectsource;__redirectToList={};')" type="button" name="btnSave" fixed_bound jQuery1291028280448="3" value="Save Draft"/>
</TD>
<TD fixed_bound>
<INPUT onclick="javascript: __doPostBack('ctl00$PlaceHolderMain$TaskForm','__update;__workflowTaskComplete={0*};__commit;__redirectsource;__redirectToList={};')" type="button" name="btnMarkSubmited" fixed_bound value="Complete Task"/>
</TD>
<TD class="ms-vb" noWrap width="99%" fixed_bound>
<INPUT onclick="javascript: __doPostBack('ctl00$PlaceHolderMain$TaskForm','__cancel;__redirectsource;__redirectToList={};')" type="button" name="btnCancel" fixed_bound value="Cancel"/>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
$('.ms-formlabel').last().children().remove();
I prefer to give an id to the tr and remove the tr by id.
$('#trid').remove();
$('#WebPartWPQ3').find('Related list item').closest('tr').remove();