I have a repeater but I know that what I've written will repeat the titles at the start of each row. I can't figure out how to update the layout so that the titles of Event, Target Day(s) and Performed Day appear vertically at the start of each row and its just the columns with the evaluated columns that repeat.
<div class="contentContainer">
<asp:HiddenField ID="hidColumnWidth" runat="server" />
<table class="dataTable fullWidth">
<tr>
<td>
<asp:Repeater ID="repTimedPathway" runat="server">
<HeaderTemplate>
<table class="fullWidth dataTable">
<tr>
<td><asp:Label runat="server" ID="lblTimedPathwayName" /></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td style='background-color:#00599B; color:white; font-size: 1.0em; border: solid 1px #000000; width: 15%;'>Event</td>
<td><%# System.Web.HttpUtility.HtmlEncode(Eval("EventTypeName")) %></td>
</tr>
<tr>
<td style='background-color:#00599B; color:white; font-size: 1.0em; border: solid 1px #000000;'>Target Day(s)</td>
<td><%#Eval("TargetDays") %></td>
</tr>
<tr>
<td style='background-color:#00599B; color:white; font-size: 1.0em; border: solid 1px #000000;'>Performed Day</td>
<td><%#Eval("PerformedDay") %></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table><br />
</FooterTemplate>
</asp:Repeater>
</td>
</tr>
</table>
</div>
I am trying to make the following page responsive. But when I hit 550px width I got the following result. If I go further down the resolution all my stuff will be slanted to the left except for the footer. I am a beginner trying to learn responsive design. I really appreciate all the help I can get. If you can provide a bit of explanation it will be great. All help is deeply appreciated. Thank you in advance.
https://jsfiddle.net/hansheung/Lhyk3s86/1/
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;" />
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans">
<title>Benefits</title>
<style type="text/css">
body {
width: 100%;
background-color: #ffffff;
margin: 0;
padding: 0;
font-family: 'Open Sans'
}
p,
h1,
h2,
h3,
h4 {
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
}
html {
width: 100%;
}
table {
font-size: 14px;
border: 0;
}
/* ----------- responsivity ----------- */
#media only screen and (max-width: 640px) {
/*------ top header ------ */
.main-header {
font-size: 20px !important;
}
.main-section-header {
font-size: 28px !important;
}
.show {
display: block !important;
}
.hide {
display: none !important;
}
.align-center {
text-align: center !important;
padding-top: 20px;
}
.align-left {
text-align: left !important;
padding-bottom: 20px;
}
.no-bg {
background: none !important;
}
/*----- main image -------*/
.main-image img {
width: 640px !important;
height: auto !important;
}
/*-------- container --------*/
.container600 {
width: 460px !important;
}
/*-------- secions ----------*/
/* .section-img img {
width: 640px !important;
height: auto !important;
} */
}
#media only screen and (max-width: 600px) {
/*------ top header ------ */
.main-header {
font-size: 18px !important;
}
.main-section-header {
font-size: 26px !important;
}
/*-------- container --------*/
.container600 {
width: 400px !important;
}
/*-------- secions ----------*/
/* .section-img img {
width: 600px !important;
height: auto !important;
} */
}
.responsive{
width: 100%;
height: auto;
}
#font-face {
font-family: Kollektif Regular;
src: url(http://www.talent-trust.com/public-html/fonts/Kollektif.woff);
}
#font-face {
font-family: Kollektif Bold;
src: url(http://www.talent-trust.com/public-html/fonts/Kollektif-Bold.woff);
}
#font-face {
font-family: Kollektif Italic;
src: url(http://www.talent-trust.com/public-html/fonts/Kollektif-Italic.woff);
}
#font-face {
font-family: Kollektik BoldItalic;
src: url(http://www.talent-trust.com/public-html/fonts/Kollektif-BoldItalic.woff);
}
.text{
color: #2d2a26;
font-size: 16px;
line-height: 28px;
text-align: justify;
}
.singleLine{
line-height:16px;
}
.doubleLine{
line-height:40px;
}
.subtitle{
font-size: 20px;
color:#FF7F30;
}
.text-color{
color: #ffffff;
font-size: 14px;
line-height: 23px;
}
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- header -->
<table width="100%" bgcolor="ffffff">
<tr>
<td >
<table align="center" width="600" class="container600">
<tr>
<td height="10" > </td>
</tr>
<tr>
<td>
<table border="0" align="center" width="600" class="container600">
<tr>
<td class="section-img">
<a href="http://www.talent-trust.com" ><img src="http://www.talent-trust.com/documents/img/j19-ttc_header.png" width="640"/></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="10"> </td>
</tr>
</table>
</td>
</tr>
</table>
<!-- end header -->
<!-- big banner section -->
<table width="100%" >
<tr>
<td align="center" valign="top" style="background:#ffffff url(http://www.talent-trust.com/documents/img/j19-ttc_banner.jpg);background-repeat:no-repeat;background-position:center;background-size:cover;border-top:0;border-bottom:0;padding-top:150px;padding-bottom:150px">
<table align="center">
<tr>
<td valign="top"></td>
</tr>
</table>
</td>
</tr>
</table>
<!--end banner-->
<table border="0" align="center" width="70%" cellpadding="0" cellspacing="0" class="container600">
<tr>
<td style="line-height: 50px;"> </td>
</tr>
<tr>
<td align="justified" style="color: #053D56; font-size: 40px; font-family: Kollektif; line-height: 28px;">
<p>Member Benefits</p>
</td>
</tr>
<tr>
<td class="doubleLine"> </td>
</tr>
<tr>
<td class="text">
At TTc, we aim to give missionaries the security, physical health, mental health, and wellness support and resources that they need to excel in their calling and stay in the field longer.
</td>
</tr>
<tr>
<td class="doubleLine"> </td>
</tr>
<tr>
<td align="center">
<table border="0" width="70%" align="center" cellpadding="0" cellspacing="0" bgcolor="#ff7f30">
<tr>
<td height="2" style="font-size: 2px; line-height: 2px;"> </td>
</tr>
</table>
</td>
</tr>
</table>
<!-- 2 Column Blog Layout-->
<table width="100%">
<tr>
<td align="center">
<table border="0" align="center" width="100%" cellpadding="0" cellspacing="0" class="container600">
<tr>
<td>
<table width="50%" align="left" cellpadding="80px" cellspacing="0" class="container600">
<tr>
<td class="align-center">
<div>
<p style="color: #053D56; font-size: 30px; font-family: Kollektif; line-height: 28px;">Keeping your costs down</p>
<br>
<p class="text">We know cost is a big deal, so we provide multiple ways to keep costs down:</p>
<br>
<p class="text">
No Claims Bonus – We reward our members for staying healthy, which helps us to keep our premiums down. See how you can save up to 50% of your premium. <a href="http://www.talent-trust.com/benefits/ncb.html" target="blank" >Read more…</a>
</p>
<br>
</div>
</td>
</tr>
</table>
<table width="50%" align="right" cellpadding="80px" cellspacing="0" class="container600">
<tr>
<td class="align-center">
<div >
<p style="color: #053D56; font-size: 30px; font-family: Kollektif; line-height: 28px;">Tailored Services help you THRIVE Long-Term</p>
<br>
<p class="text">We look at what services and technology we can offer that will help our members to stay in the field longer.</p>
<br>
<p class="text">
vHealth – a 24/7 service that connects you to a European based family doctor from anywhere in the world for free. Using an app on your phone, you can video call or have a vHealth doctor visit whenever and wherever you need it. <a href="http://www.talent-trust.com/benefits/vhealth.html" target="blank" >Read more…</a>
</p>
<br>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="50" style="font-size: 50px; line-height: 50px;"> </td>
</tr>
</table>
</td>
</tr>
</table>
<!-- end section -->
<tr>
<td class="text">
</td>
</tr>
<tr>
<td class="singleLine"> </td>
</tr>
<tr>
<td class="text">
</td>
</tr>
<tr>
<td class="singleLine"> </td>
</tr>
<tr>
<td class="text">
</td>
</tr>
<tr>
<td class="singleLine"> </td>
</tr>
<tr>
<td class="text">
</td>
</tr>
<tr>
<td class="singleLine"> </td>
</tr>
<tr>
<td class="text">
</td>
</tr>
<tr>
<td class="singleLine"> </td>
</tr>
<tr>
<td height="50" style="font-size: 30px; line-height: 30px;"> </td>
</tr>
</table>
<!-- end section -->
<!-- contact section -->
<table width="100%" bgcolor="#053D66">
<tr>
<td height="40" style="font-size: 40px; line-height: 40px;"> </td>
</tr>
<tr>
<td >
<table width="600" cellpadding="0" cellspacing="0" bgcolor="#ff7f30">
<tr>
<!-- <td height="2" style="font-size: 2px; line-height: 2px;"> </td> -->
</tr>
</table>
</td>
</tr>
<tr>
<td >
<table align="center" width="700" class="container600">
<tr>
<td>
<table width="300" align="left" cellpadding="0" cellspacing="0" class="container600">
<tr>
<!-- logo -->
<td align="right" class="align-center">
<a href="http://www.talent-trust.com" ><img width="200" border="0" style="display: block; width: 200px;" src="http://www.talent-trust.com/documents/img/j19-logo_footer.png" alt="" /></a>
</td>
</tr>
<tr>
<td height="25"> </td>
</tr>
<tr>
<td style="text-align:right;" class="align-left"><img width="24" height="24" src="http://www.talent-trust.com/documents/img/j19-fb_icon.png" ></td>
</tr>
</table>
<table width="2" align="left" cellpadding="20" cellspacing="0" style="border-collapse:collapse;" class="container600">
<tr>
<td class="hide" width="2" height="25"></td>
</tr>
</table>
<table width="250" align="left" cellpadding="0" cellspacing="0" style="border-collapse:collapse;" class="container600">
<tr>
<td align="left">
<div class="text-color">
Email us: abc#hotmail.com
</div>
</td>
</tr>
<tr>
<td height="15" style="font-size: 15px; line-height: 15px; color: #ffffff;">Tel: +604-899-8945</td>
</tr>
<tr>
<td height="33" style="font-size: 33px; line-height: 33px;"></td>
</tr>
<tr>
<td>
<table align="left" cellpadding="0" cellspacing="0">
<tr>
<td class="text-left p1"><img width=24 height=24 src="http://www.talent-trust.com/documents/img/j19-youtube_icon.png" ></td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="60"> </td>
</tr>
</table>
<!-- end section -->
I am working on the CSS applied on the table in Handlebars express.
Here's my hbs template to display my table.
<div class="table-1">
<table class="table" cellspacing="0">
<tr>
<th class="left">Item No</th>
<th class="left">Description</th>
<th class="left">Qty</th>
<th class="left"> Unit </th>
<th class="left">Prix</th>
<th class="left">Discount</th>
<th class="left">VAT</th>
<th class="left">Total</th>
</tr>
<tr>
<td> 0000 </td>
<td> Description </td>
<td> 0 </td>
<td> unit </td>
<td> 0.00 </td>
<td> 0 % </td>
<td> 0% </td>
<td> 0.00 </td>
</tr>
<tr>
<td> 0000 </td>
<td> Description </td>
<td> 0 </td>
<td> unit </td>
<td> 0.00 </td>
<td> 0 % </td>
<td> 2.5% </td>
<td> 0.00 </td>
</tr>
<tr style="width: 100%;">
<td colspan="4"></td>
<td colspan="3"> Total gross</td>
<td> 0.00 </td>
</tr>
<tr>
<td colspan="4"></td>
<td colspan="3"> Discount </td>
<td> 0.00 </td>
</tr>
<tr>
<td colspan="4"></td>
<td colspan="3"> Total Amt </td>
<td> 0.00 </td>
</tr>
</table>
</div>
Here's my css,
<!DOCTYPE html>
<html>
<head>
<style>
.table-1 .left {
text-align: left;
}
.table-1 .table td,
.table-1 .table th {
border: none;
font-weight: 300;
}
.table-1 tr:nth-child(odd) {
background-color: #EEEEEE;
}
.table-1 th,
.table-1 tr:last-child {
background-color: #16e0bb;
color: #FFFFFF;
}
.table-1 tr:last-child>td {
font-weight: 700 !important;
}
</style>
<meta charset="utf-8">
</head>
<body>
{{{body}}}
</body>
</html>
Issue: the CSS is not applied correctly when rendering the PDF template using Handlebars express. Even inline css is not working especially when using HEX color codes.
It seems, that background-color css does not work at all. What other way is there to apply background-color css on the table? To render the pdf, I'm using Handlebars express, puppeteer and NodeJS.
Expected Output:
Actual Output:
Was able to fix the issue above.
Solution: should include 'printBackground: true' in PDF options before generating the PDF from HTML with Puppeteer and NodeJS.
Thank you
I have structure as follows in fiddle.
HTML
<table width="100%" border="0" cellspacing="0" cellpadding="20" style="width:100%;">
<tbody>
<tr style="text-align:justify;">
<td valign="top"><font face="Arial,Helvetica,sans-serif" size="1" color="#333333"><span style="font-size:12px;">Hello,</span></font>
<br><br>
<font face="Arial,Helvetica,sans-serif" size="1" color="#333333"><span style="font-size:12px;">Following contact form has been submitted.</span></font>
<div>
<font face="Arial,sans-serif!important" size="1">
<span style="font-size:13px;">
<div style="margin-top:5px;"> </div>
<table width="100%" border="0" cellspacing="0" cellpadding="2" style="width:100%;">
<tbody>
<tr>
<td align="left" valign="top" style="width:17%;text-align:justify;"><font face="Arial,Helvetica,sans-serif" size="1" color="#333333"><span style="font-size:12px;"><b>Name :</b></span></font></td>
<td align="left" valign="top" style="width:83%;text-align:justify;"><font face="Arial,Helvetica,sans-serif" size="1" color="#333333"><span style="font-size:12px;">pratik </span></font></td>
</tr>
<tr>
<td align="left" valign="top" style="text-align:justify;"><font face="Arial,Helvetica,sans-serif" size="1" color="#333333"><span style="font-size:12px;"><b>Email :</b></span></font></td>
<td align="left" valign="top" style="text-align:justify;"><font face="Arial,Helvetica,sans-serif" size="1"><span style="font-size:12px;">p#d.com</span></font></td>
</tr>
<tr>
<td align="left" valign="top" style="text-align:justify;"><font face="Arial,Helvetica,sans-serif" size="1" color="#333333"><span style="font-size:12px;"><b>Phone :</b></span></font></td>
<td align="left" valign="top" style="text-align:justify;"><font size="1"><span style="font-size:12px;">8</span></font></td>
</tr>
<tr>
<td align="left" valign="top" style="text-align:justify;"><font face="Arial,Helvetica,sans-serif" size="1" color="#333333"><span style="font-size:12px;"><b>Name of Facility:</b></span></font></td>
<td align="left" valign="top" style="text-align:justify;"><font face="Arial,Helvetica,sans-serif" size="1" color="#333333"><span style="font-size:12px;">wee</span></font></td>
</tr>
</tbody>
</table>
</span>
</font>
</div>
</td>
</tr>
<tr style="text-align:justify;">
<td valign="top">
<font face="Arial,Helvetica,sans-serif" size="1" color="#333333"><span style="font-size:12px;">Thank you,</span></font>
<br>
<font face="Arial,Helvetica,sans-serif" size="1" color="#333333"><span style="font-size:12px;">Admin</span></font>
</td>
</tr>
</tbody>
</table>
So I want to keep all alignment as it is Just move "Thank you,
Admin" Section to little top
I am working on Email Template,So inline CSS
you have cell-padding table attribute, change it to 0 then design your table by css
I think this is what you need
<table width="100%" border="0" cellspacing="0" style="width:100%;padding-left:20px;">
DEMO: http://jsfiddle.net/MX9TF/3/
remove some of your empty div, and br by cleaning up the markup .
http://jsfiddle.net/MX9TF/8/
<table>
<tbody>
<tr>
<td>
<p>Hello,
<br/>Following contact form has been submitted.</p>
<table>
<tbody>
<tr>
<th>Name :</th>
<td>pratik</td>
</tr>
<tr>
<th>Email :</th>
<td>p#d.com
</td>
</tr>
<tr>
<th>Phone :</th>
<td>8</td>
</tr>
<tr>
<th>Name of Facility:</th>
<td>awee</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<p>Thank you,
<br/>Admin</p>
</td>
</tr>
</tbody>
</table>
table {
font-family:"Arial,Helvetica,sans-serif";
font-size:12px;
color:#333;
width:100%;
text-align:justify;
}
table table th {
width:17%;
font-weight:bold;
}
Then you can tune and style your tables from style sheet with plain CSS.
:)
<td style="padding-top: 1px" valign="top">
Also, you could have mentioned in the question that css is not allowed, so that we wont think that way
One more thing worth mentioning. You could figure this with some development tools such as Firebug in Firefox. eg, open your html code in a browser, use firebug inspect to select your block, and it shows you have big space over your final td. You can also try to edit in on runtime using the firebug tool. It is a firefox plugin. If you don't have firefox, other browsers too have similar development tools
The quick answer is to remove the cellpadding="20" from your parent table and use padding or <br> on each cell instead. The cellpadding and cellspacing should only be used for zero-ing out as they do not render consistently in all clients.
There are also a whole bunch of little things you don't need in your code. Here is how it should look - this will work 100% in all email clients:
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="width:100%;">
<tr>
<td valign="top" style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333; padding-bottom:30px;">
Hello,
<br><br>
Following contact form has been submitted.
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" width="17%" style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333; padding-bottom:10px;">
<b>Name:</b>
</td>
<td valign="top" width="83%" style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333; padding-bottom:10px;">
pratik
</td>
</tr>
<tr>
<td valign="top" width="17%" style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333; padding-bottom:10px;">
<b>Email:</b>
</td>
<td valign="top" width="83%" style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333; padding-bottom:10px;">
p#d.com
</td>
</tr>
<tr>
<td valign="top" width="17%" style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333; padding-bottom:10px;">
<b>Phone:</b>
</td>
<td valign="top" width="83%" style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333; padding-bottom:10px;">
#
</td>
</tr>
<tr>
<td valign="top" width="17%" style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333; padding-bottom:10px;">
<b>Name of Facility:</b>
</td>
<td valign="top" width="83%" style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333; padding-bottom:10px;">
...
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #333333; padding-top:10px;">
Thank you,<br>
Admin
</td>
</tr>
</table>
i've a 'structure' on a Asp.Net ListView like this (it is an exctract):
<asp:ListView ID="lvSchede" runat="server" DataSourceID="dsWrkCtrTable" GroupItemCount="1">
<GroupTemplate>
<tr id="itemPlaceholderContainer" runat="server">
<td id="itemPlaceholder" runat="server" style="width: 100%">
</td>
</tr>
</GroupTemplate>
<ItemTemplate>
<td id="Td2" runat="server" style="vertical-align: top;">
<table style="background-color: #EEDFCC; padding: 10px 10px 10px 10px; border-style: solid;
border-width: 1px; border-color: Gray;">
<tr>
<td>
......
......
<LayoutTemplate>
<table runat="server">
<tr runat="server">
<td runat="server">
<table id="groupPlaceholderContainer" runat="server" border="0" style="background-color: #FFFFFF;
border-color: #999999; border-style: none; font-family: Verdana, Arial, Helvetica, sans-serif;">
<tr id="groupPlaceholder" runat="server" style="padding: 20px 20px 20px 20px;">
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server" style="text-align: center; background-color: #CCCCCC; font-family: Verdana, Arial, Helvetica, sans-serif;
color: #000000;">
</td>
</tr>
</table>
</LayoutTemplate>
The problem is that my output are columns with different size (follow the image, i've manually deleted string content for my company's privacy):
Where i've to set the column size to have it ALL the same ?
Thanks
Here's an example of how to set column width inside a table with 1 column:
<table border="1" width="100%">
<col width="100">
<tr>
<th>Month</th>
</tr>
<tr>
<td>January</td>
</tr>
<tr>
<td>February</td>
</tr>
</table>
This is an example with 2 columns:
<table border="1" width="100%">
<col width="100">
<col width="50">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
This is an example with 3 columns:
<table border="1" width="100%">
<col width="40">
<col width="40">
<col width="20">
<tr>
<th>Month</th>
<th>Savings</th>
<th>Loans</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
<td>$10</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
<td>$8</td>
</tr>
</table>
Hope this helps out at least a bit.