adding numbers in texboxes - addition

I have 7 text boxes. I want to add the value of 7 and insert the total in to another textbox. How can i achieve that with out postback. I have also tried to update panel but it is not working. my code is as follows. ANy suggestions in this regards would be much appreciable
If Page.IsPostBack Then
Dim A1 As Double
A1 = A_SAtxt.Text
Dim A2 As Double
A2 = A_SStxt.Text
Dim A3 As Double
A3 = A_RAtxt.Text
Dim A4 As Double
A4 = A_CAtxt.Text
Dim A5 As Double
A5 = A_OItxt.Text
Dim A6 As Double
A6 = A_ICtxt.Text
Dim A7 As Double
A7 = A_Otxt.Text
Dim ATotal = A1 + A2 + A3 + A4 + A5 + A6 + A7
End If
I working in asp.net with VB. textbox code in asp.net is as follows
<table width="100%">
<tr>
<td align="left" style="border:1px solid #cccccc; text- align: right; background-color: #F0F0F0;"
valign="top" class="style7" width = "400px">
<asp:Label ID="Label154" runat="server" Text="Savings account $"></asp:Label>
</td>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: left; background-color: #F0F0F0;"
valign="top">
<asp:TextBox ID="A_SAtxt" runat="server" CssClass="DrpItems10"
style="text-align: left" MaxLength="25"></asp:TextBox>
</td>
</tr>
<tr>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: right; background-color: #F0F0F0;"
valign="top">
<asp:Label ID="Label155" runat="server" Text="Stock and securities $"></asp:Label>
</td>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: left; background-color: #F0F0F0;"
valign="top">
<asp:TextBox ID="A_SStxt" runat="server" CssClass="DrpItems10"
style="text-align: left" MaxLength="25"></asp:TextBox>
</td>
</tr>
<tr>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: right; background-color: #F0F0F0;"
valign="top">
<asp:Label ID="Label156" runat="server" Text="Retirement accounts $"></asp:Label>
</td>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: left; background-color: #F0F0F0;"
valign="top">
<asp:TextBox ID="A_RAtxt" runat="server" CssClass="DrpItems10"
style="text-align: left" MaxLength="25"></asp:TextBox>
</td>
</tr>
<tr>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: right; background-color: #F0F0F0;"
valign="top">
<asp:Label ID="Label157" runat="server" Text="Checking account $"></asp:Label>
</td>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: left; background-color: #F0F0F0;"
valign="top">
<asp:TextBox ID="A_CAtxt" runat="server" CssClass="DrpItems10"
style="text-align: left" MaxLength="25"></asp:TextBox>
</td>
</tr>
<tr>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: right; background-color: #F0F0F0;"
valign="top">
<asp:Label ID="Label158" runat="server" Text="Other investments $"></asp:Label>
</td>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: left; background-color: #F0F0F0;"
valign="top">
<asp:TextBox ID="A_OItxt" runat="server" CssClass="DrpItems10"
style="text-align: left" MaxLength="25"></asp:TextBox>
</td>
</tr>
<tr>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: right; background-color: #F0F0F0;"
valign="top">
<asp:Label ID="Label159" runat="server" Text="Insurace cash-in-value $"></asp:Label>
</td>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: left; background-color: #F0F0F0;"
valign="top">
<asp:TextBox ID="A_ICtxt" runat="server" CssClass="DrpItems10"
style="text-align: left" MaxLength="25"></asp:TextBox>
</td>
</tr>
<tr>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: right; background-color: #F0F0F0;"
valign="top">
<asp:Label ID="Label160" runat="server" Text="Other $"></asp:Label>
</td>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: left; background-color: #F0F0F0;"
valign="top">
<asp:TextBox ID="A_Otxt" runat="server" CssClass="DrpItems10"
style="text-align: left" MaxLength="30"></asp:TextBox>
<asp:Label ID="Label188" runat="server" Text="specify:" Font-Italic="true"></asp:Label>
<asp:TextBox ID="A_OStxt" runat="server" CssClass="DrpItems10"
style="text-align: left" Width="250px" MaxLength="100"></asp:TextBox>
</td>
</tr>
<tr>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: right; background-color: #F0F0F0;"
valign="top">
<asp:Label ID="Label161" runat="server" Text="Total assets $"></asp:Label>
</td>
<td align="center" class="style7"
style="border:1px solid #cccccc; text-align: left; background-color: #F0F0F0;"
valign="top">
<asp:TextBox ID="A_TAtxt" runat="server" CssClass="DrpItems10"
style="text-align: left" MaxLength="25"></asp:TextBox>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
I have even tried doing this but it doesn't seems to work
Dim sb As New System.Text.StringBuilder()
sb.Append("<script type = 'text/javascript'>")
sb.Append(" $(document).ready(function() {")
sb.Append(" var numberInput = $('#A_SAtxt, #A_SStxt, #A_RAtxt, #A_CAtxt,
#A_OItxt, #A_ICtxt, #A_Otxt');")
sb.Append(" numberInput.on('change', function() {")
sb.Append(" var total = 0;")
sb.Append("else{")
sb.Append(" numberInput.each(function() {")
sb.Append(" if ($(this).val() !== '') {")
sb.Append(" total += parseFloat($(this).val());")
sb.Append(" }")
sb.Append(" });")
sb.Append(" $('#A_TAtxt').val(total);")
sb.Append(" });")
sb.Append(" });​")
sb.Append("}};</script>")
ClientScript.RegisterClientScriptBlock(Me.GetType(), "function", sb.ToString())

You can use jQuery or javascript to calculate the sum of the 7 input boxes and insert the value into another input on the client side.
JAVASCRIPT
var total = 0;
$('#A_SAtxt, #A_SStxt, #A_RAtxt, #A_CAtxt, #A_OItxt, #A_ICtxt, #A_Otxt').each(function() {
if ($(this).val() !== '') {
total += parseFloat($(this).val());
}
});
$('#A_TAtxt').val(total);
DEMO
Here is an example of this code in action:
http://jsfiddle.net/AWGsw/2/
*EDIT 1*
To call this function on page load and to immediately add values on input blur, do the following:
JAVASCRIPT
$(document).ready(function() {
var numberInput = $('#A_SAtxt, #A_SStxt, #A_RAtxt, #A_CAtxt, #A_OItxt, #A_ICtxt, #A_Otxt');
numberInput.on('change', function() {
var total = 0;
numberInput.each(function() {
if ($(this).val() !== '') {
total += parseFloat($(this).val());
}
});
$('#A_TAtxt').val(total);
});
});
DEMO
http://jsfiddle.net/AWGsw/4/

Related

Outlook email signature looks stretched

When I insert the HTML file into outlook and then view it, it looks all stretched vertically, but when viewing it on the browser it looks perfect.
When I view the email signature in the outlook "Signatures and Stationary" window it also looks right but when inserting it into the body of the email message it gets stretched.
Taken all the height property out of HTML code.
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Wagma E-Signature</title>
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Raleway:100,200,400,500,600,700,800,900" />
<style type="text/css">
/* Client-Specific styles */
#outlook a { padding:0; } /* Force Outlook to provide a "view in browser" menu link. */
body { width:100% !important; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; margin:0; padding:0; border:0; }
/* Prevent Webkit and Windows Mobile platforms from changing default font sizes, while not breaking desktop design. */
.ExternalClass { width:100%; } /* Force Hotmail to display emails at full width */
.ExternalClass,
.ExternalClass p,
.ExternalClass span,
.ExternalClass font,
.ExternalClass td,
.ExternalClass div { line-height:100%; } /* Force Hotmail to display normal line spacing.*/
img { outline:none; text-decoration:none;border:none; -ms-interpolation-mode:bicubic; }
a img { border:none; text-decoration:none;border:none; -ms-interpolation-mode:bicubic; }
p { margin:0px 0px !important; }
table { border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; }
table td { border-collapse:collapse; }
/* iPad Styles */
#media only screen and (max-width: 640px) {
a[href^="tel"], a[href^="sms"] {
text-decoration:none;
color:#000000;
pointer-events:none;
cursor:default;
}
.mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
text-decoration:default;
color:#000000 !important;
pointer-events:auto;
cursor:default;
}
}
/* iPhone Styles */
#media only screen and (max-width: 480px) {
a[href^="tel"], a[href^="sms"] {
text-decoration:none;
color:#000000;
pointer-events:none;
cursor:default;
}
.mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
text-decoration:default;
color:#000000 !important;
pointer-events:auto;
cursor:default;
}
}
/* Responsive styles */
#media only screen and (max-width: 480px) {
td[class=wrapper] {
padding-top:0 !important;
padding-left:0 !important;
padding-right:0 !important;
}
table[class=mobile-view], td[class=mobile-view], img[class=mobile-view] {
width:320px !important;
height:auto !important;
}
td[class=clump] {
display:block !important;
padding-left:0 !important;
padding-right:0 !important;
width:100% !important;
}
td[class=aligncenter] {
width:300px !important;
height:auto !important;
text-align:center !important;
}
}
</style>
</head>
<body>
<table width="490" border="0" cellspacing="0" cellpadding="0" class="mobile-view" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tbody>
<tr>
<td>
<table width="490" border="0" cellspacing="0" cellpadding="0" class="mobile-view" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tbody>
<tr>
<td width="130" align="left" valign="top" class="clump" style="padding:0 0 10px 0; background:#eff1f6;">
<!-- Add your Avatar -->
<img src="image/LOGO-WAGMA 320 X 320.png" alt="Avatar" border="0" width="120" style="padding:10px 0 0 10px; display:block; border:0; outline:none;" />
</td>
<td width="360" align="left" valign="top" class="clump" style="padding:10px 0 0 0; background:#eff1f6;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tbody>
<tr>
<td style="padding:0 10px 0 15px;" align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tr>
<!-- Edit your Name or Title -->
<td style="font-family:'Raleway', sans-serif, Arial; font-size:18px; line-height:24px; font-weight:900; color:#2f3542; padding:10px 0 0 0;">Andrew Magombedze</td>
</tr>
<tr>
<!-- Edit your job title or subtitle -->
<td style="font-family:'Raleway', sans-serif, Arial; font-size:12px; line-height:18px; font-weight:500; color:#6e7482; padding:0 0 10px 0;">SHEQ Consultant</td>
</tr>
<!-- Edit your job title or subtitle -->
<tr>
<td style="font-family:'Raleway', sans-serif, Arial; font-size:10px; line-height:12px; font-weight:400; color:#6e7482; padding:0 0 10px 0;">Bsc (Hons) Enviro, SAMTRAC<br>ISO 14001, 18001 Implementation<br>ISO 14001, 18001 Internal Auditor<br>Sacpcmp - CanCHSM</td>
</tr>
<tr>
<!-- Edit your Address -->
<td style="font-family:'Raleway', sans-serif, Arial; font-size:12px; line-height:18px; font-weight:600; color:#2f3542; padding:5px 0 0 0;">Office 192 Woodlands Gardens, 92 Bellairs Drive, Northriding, Randburg</td>
</tr>
<tr>
<!-- Edit your website's URL -->
<td style="font-family:'Raleway', sans-serif, Arial; font-size:16px; line-height:30px; font-weight:800; color:#60d853; padding:0 0 10px 0;">Wagma-SHEQ.co.za</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table width="490" border="0" cellspacing="0" cellpadding="0" class="mobile-view" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tbody>
<tr>
<td width="63%" style="padding:12px 0 5px 10px; background:#e1e4ed;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tbody>
<tr>
<td width="50%" class="clump">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tbody>
<tr>
<td width="25" valign="top"><img src="image/icon_green_phone.png" alt="Phone" border="0" width="22" style="display:block; border:0; outline:none;" /></td>
<!-- Edit your Phone number -->
<td width="" valign="top" align="left" style="font-family:'Raleway', sans-serif, Arial; font-size:12px; line-height:24px; font-weight:600; color:#2f3542;"> +27 78 762 7712</td>
</tr>
</tbody>
</table>
</td>
<td width="50%" class="clump">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;">
<tbody>
<tr>
<td width="25" valign="top"><img src="image/icon_green_email.png" alt="Email" border="0" width="22" style="display:block; border:0; outline:none;" /></td>
<!-- Edit your Email address -->
<td width="" valign="top" align="left" style="font-family:'Raleway', sans-serif, Arial; font-size:12px; line-height:24px; font-weight:600; color:#2f3542;">andrewm#wagma-sheq.co.za</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>
It looks like you need to specify your height attribute too on the images.
So for example instead of this:
<img src="image/LOGO-WAGMA 320 X 320.png" alt="Avatar" border="0" width="120"
style="padding:10px 0 0 10px; display:block; border:0; outline:none;" />
Try:
<img src="image/LOGO-WAGMA 320 X 320.png" alt="Avatar" border="0" width="120"
height="120" style="padding:10px 0 0 10px; display:block; border:0; outline:none;" />
If you need to cater for mobile responsiveness, you treat the width and height attributes as default (for Outlook), and an inline style for everything else:
<img src="image/LOGO-WAGMA 320 X 320.png" alt="Avatar" border="0" width="120"
height="120" style="width:120px;height:auto;max-width:120px; padding:10px 0 0 10px; display:block; border:0; outline:none;" />

Spacing in Email

I have a web version that's displaying fine. When I send a test email, it shows unwanted spacing between the images. I tried changing the the padding and margin , but nothing's working. Why is it doing that?
https://jsfiddle.net/tantalizea/r49oqbjj/
CSS:
a,
body,
div,
img,
span,
table,
td,
tr {
margin: 0;
padding: 0;
border: 0;
}
a {
color: #231F20;
font-weight: bold;
text-decoration: none
}
a[href^="x-apple-data-detectors:"] {
color: inherit;
text-decoration: inherit;
}
area {
outline: none
}
body {
font: normal 100% Arial, Helvetica, sans-serif;
background: #FFF;
color: #231F20
}
img {
border: none;
width: 100%;
height: auto
}
.container {
width: 600px;
margin: 0 auto;
max-width: 600px
}
#preheader {
display: none !important;
visibility: hidden;
opacity: 0;
color: #FFFFFF;
color: transparent;
height: 0;
width: 0;
font-size: 0px
}
.desktop {
display: table !important;
margin: 0 auto !important;
}
tr.desktop {
display: table-row !important
}
td.desktop {
display: table-cell !important
}
img.desktop {
display: inline !important
}
.mobile {
display: none !important
}
.break {
display: inline !important
}
#media screen and (max-width: 600px) {
.container {
width: 97.5%
}
.desktop,
tr.desktop,
td.desktop,
img.desktop {
display: none !important
}
.mobile {
display: table !important
}
tr.mobile {
display: table-row !important
}
td.mobile2 {
display: table !important;
width: 100%;
text-align: center !important
}
td.mobile {
display: table-cell !important
}
.break {
display: none !important
}
.hidden {
display: none !important
}
.no-border {
border: none !important
}
.smaller {
font-size: 200% !important
}
.smaller2 {
font-size: 100% !important
}
.center {
text-align: center !important
}
.margin {
margin: 0 auto
}
.image {
width: 100px !important
}
.width-100 {
width: 100% !important
}
}
HTML:
<body style="background:#FFF; color:#858585">
<div id="preheader" style="display:none; visibility:hidden; opacity:0; color:#878787; color:transparent; height:0; width:0; font-size:0px;">Tuesday, March 7, 2017 | 9840 International Drive, Orlando, Florida | Booth #613</div>
<!-- /div#preheader -->
<div class="container" style="margin:0 auto; max-width:600px">
<table cellpadding="0" cellspacing="0" border="0" align="center" class="container" style="margin:0 auto; max-width:600px">
<tr class="bronto">
<td height="20"></td>
</tr>
<tr class="bronto">
<td align="center"><span style="font:normal 68.75% Helvetica, Arial, sans-serif; color:#858585">Is this email not displaying correctly? Try the web version.</span></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" align="center" border="0" width="100%">
<tr>
<td height="20"></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" align="center" border="0" width="100%">
<tr>
<td width="35" class="desktop"> </td>
<td align="center">
<table cellpadding="0" cellspacing="0" align="center" border="0" width="100%">
<tr>
<td align="left" valign="bottom" width="76%"><span style="font:normal 300% Times, 'Times New Roman', serif; color:#56565a; line-height:100%" class="smaller"><strong><em>You're Invited!</em></strong></span></td>
<td style="text-align:right" width="24%"><img src="http://www.kravetcontract.com/email_blasts/tipin.png" alt="KK" style="max-width:144px; width:100%" /></td>
</tr>
</table>
</td>
<td width="35" class="desktop"> </td>
</tr>
<!--<tr class="mobile">
<td class="mobile">
<table cellpadding="0" cellspacing="0" align="center" border="0" width="100%" class="mobile">
<tr class="mobile">
<td height="20" class="mobile"></td>
</tr>
<tr class="mobile">
<td align="center" class="mobile"><span style="font:normal 200% Times, 'Times New Roman', serif; color:#57565b;" class="mobile"><strong><em>You're Invited!</em></strong></span></td>
</tr>
</table>
</td>
</tr>-->
</table>
</td>
</tr>
<tr>
<td height="20"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" valign="top"><img src="http://www.kravetcontract.com/email_blasts/newh-2017/top.jpg" alt="Top" style="max-width:600px" /></td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" align="center" border="0" width="100%">
<tr>
<td align="left" valign="middle" class="desktop" width="78"><img src="http://www.kravetcontract.com/email_blasts/newh-2017/left.jpg" alt="Left" style="max-width:78px" /></td>
<td align="center" valign="middle" bgcolor="#FFFFFF">
<table cellpadding="0" cellspacing="20" align="center" border="0" width="100%">
<tr>
<td align="center"><span style="font:normal 100% Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; color:#101011; letter-spacing:1px">PLEASE JOIN</span></td>
</tr>
<tr>
<td align="center"><img src="http://www.kravetcontract.com/email_blasts/BDNY2016/logo.png" alt="kravetcontract" style="max-width:280px" /></td>
</tr>
<tr>
<td align="center"><span style="font:normal 100% Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; color:#101011; letter-spacing:1.5px">AT THIS YEAR'S</span></td>
</tr>
<tr>
<td align="center"><img src="http://www.kravetcontract.com/email_blasts/newh-2017/newh_logo_2.png" alt="NEWH" style="max-width:192px" /></td>
</tr>
<tr>
<td align="center" valign="middle"><span style="font:normal 100% Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; color:#101011;letter-spacing:1.5px">MARCH 7, 2017 AT 12PM-6PM<br />
BOOTH #613</span></td>
</tr>
<tr>
<td align="center" valign="middle"><span style="font:normal 81.25% Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; color:#101011; letter-spacing:1.5px">9840 International Drive<br />
Orlando, Florida</span></td>
</tr>
<tr>
<td align="center"><span style="font:normal 100% Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; color:#101011; line-height:21px; letter-spacing:1.5px">We look forward to seeing you.</span></td>
</tr>
</table>
</td>
<td align="right" valign="middle" class="desktop" width="78"><img src="http://www.kravetcontract.com/email_blasts/newh-2017/right.jpg" alt="Right" style="max-width:78px" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" valign="top"><img src="http://www.kravetcontract.com/email_blasts/newh-2017/bottom.jpg" alt="Bottom" style="max-width:600px" /></td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#56565a">
<table cellpadding="0" cellspacing="5" align="center" border="0">
<tr>
<td bgcolor="#56565a">GET DIRECTIONS <strong style="font-family:Arial, sans-serif;">►</strong></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="20"></td>
</tr>
<tr>
<td><img src="http://www.kravet.com/style-spotlight/one-family.gif" alt="One Family. Ninety-Eight Years." border="0" style="border:none; width:100%" /></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td align="center"><span style="font:normal 150% Helvetica, Arial, sans-serif; color:#858585"><span style="font:normal 87.5%/4mm Helvetica, Arial, sans-serif; color:#858585">#</span>kravetinc</span>
</td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td align="center">
<table cellpadding="0" cellspacing="0" align="center" border="0">
<tr>
<td>
<img src="http://www.kravet.com/style-spotlight/instagram.gif" alt="Instagram" border="0" style="border:none; width:100%; max-width:50px" />
</td>
<td width="10"> </td>
<td>
<img src="http://www.kravet.com/style-spotlight/facebook.gif" alt="Facebook" border="0" style="border:none; width:100%; max-width:50px" />
</td>
<td width="10"> </td>
<td>
<img src="http://www.kravet.com/style-spotlight/pinterest.gif" alt="Pinterest" border="0" style="border:none; width:100%; max-width:50px" />
</td>
<td width="10"> </td>
<td>
<img src="http://www.kravet.com/style-spotlight/twitter.gif" alt="Twitter" border="0" style="border:none; width:100%; max-width:50px" />
</td>
<td width="10"> </td>
<td>
<img src="http://www.kravet.com/style-spotlight/houzz.gif" alt="Houzz" border="0" style="border:none; width:100%; max-width:50px" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td align="center">e-designtrade.com</td>
</tr>
<tr>
<td height="40"></td>
</tr>
<tr>
<td align="center"><span style="font:normal 75% Helvetica, Arial, sans-serif; color:#858585">KRAVET® INC | CONTACT US | PRIVACY POLICY</span></td>
</tr>
<tr>
<td align="center"><span style="font:bold 75% Helvetica, Arial, sans-serif; color:#858585">Exclusively Available Through Interior Designers</span></td>
</tr>
<tr>
<td height="40"></td>
</tr>
<tr class="bronto">
<td align="center"><span style="font: normal 68.75% Helvetica, Arial, sans-serif; color: #858585;" xml="lang">This email was sent to %%!contact_email%% by %%!account_organization%%</span></td>
</tr>
<tr class="bronto">
<td align="center"><span style="font: normal 68.75% Helvetica, Arial, sans-serif; color: #858585;" xml="lang">%%!account_address1%% | %%!account_city%%, %%!account_state%% %%!account_zip%%</span></td>
</tr>
<tr class="bronto">
<td align="center"><span style="font:normal 68.75% Helvetica, Arial, sans-serif; color:#858585">Forward to a friend | Manage Preferences | Unsubscribe</span></td>
</tr>
<tr>
<td height="40"></td>
</tr>
</table>
<!-- /table.container -->
</div>
<!-- /div.container -->
</body>
Try using display block on all images.
style="display:block;"
This is a must have on all images.
Cheers
To be quite honest, I actually love the way it looks haha.
But I believe your issue is the img. It's based on the width. The aspect ratio makes the height smaller then the size of the table row. This is probably not the best way to fix it, but after going through a bunch of css changes I couldn't get it to work any other way:
On the specific images. Set the img style to be moved 4 px down:
transform: translateY(4px);
Bottom image, 4 px up:
transform: translateY(-4px);
Ex:
Bottom:
<img src="http://www.kravetcontract.com/email_blasts/newh-2017/bottom.jpg" alt="Bottom" style="max-width:600px;transform: translateY(-4px);">
Should look like this:

dompdf - blank pages are generated when setting td width - dompdf 0.6.1 v3

I'm trying to create table with three equal columns
Table width is set to 100%
When I'm trying to set width: 33% on TABLE TD element dompdf generates 1+ blank page(s) before generates the table. The table generates as expected only those blank pages are present in pdf document.
PDF FILE with width: 33%: http://www.docdroid.net/b5cf/with-width.pdf.html
I need to have equal columns on this table and cant achive it with width="33%" or style="table-layout: fixed" without geting the blank pages befor the table.
The HTML looks like this
<table class="outer_tab">
<tbody>
<tr class="outer_tr">
<td valign="top" class="outer_td">
<table class="inner_tab">
<tbody>
<tr>
<th valign="top" colspan="2">I.</th>
</tr>
<tr>
<td valign="top" class="inner_td">
<span class="separator">Morfologia ogólna</span>
</td>
</tr>
<tr>
<td valign="top" class="inner_td">
<span class="lp">1.
<span style="font-weight: bold;"> HCT </span> - <span class="inner_td_text">Hematokryt</span>
</span>
</td>
</tr>
</tbody>
</table>
</td>
<td valign="top" class="outer_td">
<table class="inner_tab">
<tbody>
<tr>
<th valign="top" colspan="2">II.</th>
</tr>
<tr>
<td valign="top" class="inner_td">
<span class="separator">Morfologia ogólna</span>
</td>
</tr>
<tr>
<td valign="top" class="inner_td">
<span class="lp">1.
<span style="font-weight: bold;"> HCT </span> - <span class="inner_td_text">Hematokryt</span>
</span>
</td>
</tr>
</tbody>
</table>
</td>
<td valign="top" class="outer_td">
<table class="inner_tab">
<tbody>
<tr>
<th valign="top" colspan="2">III.</th>
</tr>
<tr>
<td valign="top" class="inner_td">
<span class="separator">Morfologia ogólna</span>
</td>
</tr>
<tr>
<td valign="top" class="inner_td">
<span class="lp">1.
<span style="font-weight: bold;"> HCT </span> - <span class="inner_td_text">Hematokryt</span>
</span>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
CSS looks like this:
<style type="text/css">
#page { margin: 1cm; }
body {
background-image: url('<?php echo 'module/Application/assets/pdf/images/faktury-tlo-small.png'; ?>');
background-repeat: no-repeat;
background-size: 20%;
background-position: center center;
}
table.outer_tab, table.inner_tab { border-spacing: 0; width: 100% }
table.inner_tab th { text-align: center; background: #BDC0BF; font-size: 15px; font-weight: bold; padding: 2px 0; }
td.outer_td { border-top: 1px solid #BDC0BF; border-left: 1px solid #BDC0BF; /*width: 33%;*/ border-bottom: 1px solid #BDC0BF; }
td.outer_td:last-of-type { border-right: 1px solid #BDC0BF; }
tr.outer_tr:last-of-type td.outer_td { border-bottom: 1px solid #BDC0BF; }
span.lp { padding-left: 10px; display: block; }
span.inner_td_text { /*padding-right: 10px;*/ }
span.separator { font-weight: bold; text-align: center; font-size: 15px; padding-bottom: 10px; display: block; }
.footer { position: fixed; bottom: 0px; width: 100%; font-size: 11px; }
</style>
The line cosing problems is:
td.outer_td { border-top: 1px solid #BDC0BF; border-left: 1px solid #BDC0BF; /*width: 33%;*/ border-bottom: 1px solid #BDC0BF; }
If in this td.outer_td has width: 33% the PDF has blank pages before the table
Anyone has any idea why this is happening?
Any solutions to this problem?

Joomla 3 changes

I have a joomla 3.0.3. (upgraded from 2.5). But the joomla keeps changing my html code when I save a custom html module.
I am using the JCK editor and have tried "none" editor as well but that doesn't change it. I have also switched the text filter permissions in the global settings to "no filtering"... no change ether.
This is the code I am entering (an image and a table):
<p style="text-align: center;">
<img alt="En verden af skønne og skæve blomster" src="images/Content/General/skoenneogskaeveblomster.png" style="width: 428px; height: 39px;" /></p>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
<tbody>
<tr>
<td style="text-align: center; vertical-align: top; width: 20%;">
<strong>Nyhedsmail</strong></td>
<td style="text-align: center; vertical-align: top; width: 20%;">
<strong>Adresse</strong></td>
<td style="text-align: center; vertical-align: top; width: 20%;">
<strong>Kontakt</strong></td>
<td style="text-align: center; vertical-align: top; width: 20%;">
<strong>Bankoplysninger</strong></td>
<td colspan="2" rowspan="1" style="text-align: center; vertical-align: top; width: 20%;">
<strong>Åbningstider</strong></td>
</tr>
<tr>
<td style="text-align: center; vertical-align: top; width: 20%;">
<p>
Gå ikke glip af tilbud og arangmenter.</p>
<p>
<a href="http://blomstergalleriet-viborg.dk/>Tilmeld dig vores nyhedsmail.</a></p>
</td>
<td style="text-align: center; vertical-align: top; width: 20%;">
<p>
Blomster Galleriet</p>
<p>
Li. Sct. Mikkelsgade 19</p>
<p>
8800 Viborg</p>
</td>
<td style="text-align: center; vertical-align: top; width: 20%;">
<p>
Tlf: 86 84 86 84</p>
<p>
Email: someemail</p>
</td>
<td style="text-align: center; vertical-align: top; width: 20%;">
<p>
Reg. nr: 2783</p>
<p>
Konto nr: 4380 1656 49</p>
</td>
<td style="text-align: right; vertical-align: top; width: 10%;">
<p>
Mandag - Fredag:</p>
<p>
Lørdag:</p>
</td>
<td style="text-align: center; vertical-align: top; width: 10%;">
<p>
9:30 - 17:30</p>
<p>
9:30 - 13:00</p>
</td>
</tr>
<tr>
<td style="text-align: center; vertical-align: top; width: 20%;">
</td>
<td style="text-align: center; vertical-align: top; width: 20%;">
</td>
<td style="text-align: center; vertical-align: top; width: 20%;">
</td>
<td style="text-align: center; vertical-align: top; width: 20%;">
</td>
<td colspan="2" rowspan="1" style="vertical-align: top; width: 10%; text-align: center;">
<strong>Specielle åbningstider</strong></td>
</tr>
<tr>
<td style="text-align: center; vertical-align: top; width: 20%;">
</td>
<td style="text-align: center; vertical-align: top; width: 20%;">
</td>
<td style="text-align: center; vertical-align: top; width: 20%;">
</td>
<td style="text-align: center; vertical-align: top; width: 20%;">
</td>
<td style="text-align: right; vertical-align: top; width: 10%;">
<p>
Store bededag:</p>
<p>
Mors dag:</p>
<p>
Pinse dag:</p>
<p>
2. Pinse dag:</p>
<p>
Uge 29-30:</p>
</td>
<td style="text-align: center; vertical-align: top; width: 10%;">
<p>
9:30 - 13:00</p>
<p>
7:00 - 14:00</p>
<p>
Lukket</p>
<p>
Lukket</p>
<p>
Ferielukket</p>
</td>
</tr>
</tbody>
Webmaster og designer: Me
But when I have saved it looks like this:
<p>
<p center;\"=""> <img af="" alt="\"En" nne="" og="" src="\"images/Content/General/skoenneogskaeveblomster.png\"" ve="" verden="" /></p>
<p>
Nyhedsmail</p>
<table border="\"0\"" cellpadding="\"0\"" cellspacing="\"0\"" td="">
<tbody>
<tr>
<td a="" af="" dig="" glip="" href="\"http://blomstergalleriet-viborg.dk/" ikke="" og="" td="" tilbud="" tilmeld="" vores="">
<p>
Blomster Galleriet</p>
<p>
Li. Sct. Mikkelsgade 19</p>
<p>
8800 Viborg</p>
</td>
<td 84="" 86="" a="" href="\"mailto:someemail?subject=Blomster%20Galleriet\"" td="">
<p>
Reg. nr: 2783</p>
<p>
Konto nr: 4380 1656 49</p>
</td>
<td -="" mandag="" td="">
<p>
9:30 - 17:30</p>
<p>
9:30 - 13:00</p>
</td>
</tr>
<tr>
<td td="">
</td>
<td td="">
</td>
<td colspan="\"2\"" rowspan="\"1\"" specielle="" td="">
</td>
<td td="">
</td>
<td td="">
<p>
Store bededag:</p>
<p>
Mors dag:</p>
<p>
Pinse dag:</p>
<p>
2. Pinse dag:</p>
<p>
Uge 29-30:</p>
</td>
<td -="" 7:00="" 9:30="" p="">
<em><span 9px;\"="">Webmaster og designer: Me</em></td>
</tr>
</tbody>
As you can see the following changes:
* Image doesn't load
* links changing
* text size changes
* table changes
I hope someone knows what to do.
Did you toggle the editor off (show the HTML source) when entering the HTML tags? Otherwise the editors usually assume you want to enter some text and changes the HTML tags so it's safe to show.
Or your server does some funny things on its own.
I got it to Work now. I think it was something about the magic quotes setting on the PHP setup.

throw an error message when user selects items more than 5

I have the following view that i need to display an error message when user tries to submit with items selected greater than 5. I could do this on the controller side but could i use jquery in the view to do this? I think jquery would be lot easier and faster.
Here is my code:
#using (Html.BeginForm())
{
<h1>Manage Testimonials</h1>
<p><b>Please select up to 5 testimonials you want to include for your sales flyers. A maximum of only 5 testimonials is allowed.</b></p>
<div>
<table width="100%" cellpadding="0" cellspacing="0" rules="all">
<thead>
<tr>
<td align="center" style="padding: 2px 0 2px 2px;">Select</td>
<td align="center" style="padding: 2px 0 2px 2px;">First Name</td>
<td align="center" style="padding: 2px 0 2px 2px;">Last Name</td>
<td align="center" style="padding: 2px 0 2px 2px;">Testimonial</td>
</tr>
</thead>
#{ var i = 0;
}
#foreach (var testimonials in Model.Testimonials)
{
<tr>
<td style="padding: 2px 0 2px 2px;">
#Html.CheckBox("Testimonials[" + i.ToString() + "].DisplayTestimonials", testimonials.DisplayTestimonials.Value, new { #class = "chkItems" })
#Html.Hidden("Testimonials[" + i.ToString() + "].ResponseId", testimonials.ResponseId.ToString())
</td>
<td style="padding: 2px 0 2px 2px;">#Html.Label(testimonials.FirstName)</td>
<td style="padding: 2px 0 2px 2px;">#Html.Label(testimonials.LastName)</td>
<td style="padding: 2px 0 2px 2px;">#Html.Label("Testimonials[" + i.ToString() + "].Question5Answer", testimonials.Question5Answer.ToString())</td>
</tr>
i++;
}
</table>
<p>
<input type="submit" id="Submit" value="Save" class="PremierSubmitButton" /></p>
</div>
}
Don't rely on javascript, always validate data on server side. Maybe user disabled javascript in browser. use Ajax form reqest if you need ajax for this.
Stay DRY ;)

Resources