I have an email template that I need to update. I have to make the right image show at the bottom below repair id when it is viewed only in mobile. As of right now I have tried media queries but I had no luck but possible I didn't use correctly. Would love a solution to make it more responsive.
<style>
#media (max-width: 480px){
#productimage {
position: relative ;
top: 200px;
left: -100px;
}
}
</style>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="570" style="background-image: url('https://www.marahlago.com/assets/images/ml-flower-watermark-.png'); background-repeat:no-repeat ;background-position:center;">
<tbody>
<tr>
<td height="15">
<div class="wrapper" style="width: 400px;margin-left: auto;margin-right: auto;">
<div class="top-mar-logo" style="text-align: center;padding: 40px 0px;">
<p>Dear [ADMIN NAME],</p>
<p>[FIRST NAME] has sent a repair piece. Please check the details below</p>
</div>
</div>
</td>
</tr>
<tr>
<td align="" style="border:0px solid #999999;">
<table border="0" width="100%">
<tbody>
<tr>
<td valign="top" width="60%">
<table border="0" cellpadding="4" cellspacing="" width="100%">
<tbody>
<tr>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;"><strong>Customer Name</strong> </span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">:</span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">[FIRST NAME] [LAST NAME]</span></td>
</tr>
<tr>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;"><strong>Customer Email</strong> </span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">:</span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">[EMAIL]</span></td>
</tr>
<tr>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;"><strong>Product Name</strong> </span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">:</span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">[PRODUCT NAME]</span></td>
</tr>
<tr>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;"><strong>Purchased On</strong> </span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">:</span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">[DATE]</span></td>
</tr>
<tr>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;"><strong>Return Reason</strong></span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">:</span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">[CUS NOTE]</span></td>
</tr>
<tr>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;"><strong>Repair ID</strong></span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">:</span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">[REPAIR ID]</span></td>
</tr>
</tbody>
</table>
</td>
<td align="center" width="40%" id="productimage"><img src="[PRODUCTIMAGE]" alt="" width="100%" height="250px" class="fr-fic fr-dii"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
Not sure what to use.
Hope this may help you.
Please don't forget to add <meta name="viewport" content="width=device-width, initial-scale=1"> in your head tag.
#media (max-width: 480px){
.table-row{
display: block;
}
#productimage {
position: relative ;
display: block;
width:100%;
}
}
<table align="center" border="0" cellpadding="0" cellspacing="0" width="570" style="background-image: url('https://www.marahlago.com/assets/images/ml-flower-watermark-.png'); background-repeat:no-repeat ;background-position:center;">
<tbody>
<tr>
<td height="15">
<div class="wrapper" style="width: 400px;margin-left: auto;margin-right: auto;">
<div class="top-mar-logo" style="text-align: center;padding: 40px 0px;">
<p>Dear [ADMIN NAME],</p>
<p>[FIRST NAME] has sent a repair piece. Please check the details below</p>
</div>
</div>
</td>
</tr>
<tr>
<td align="" style="border:0px solid #999999;">
<table border="0" width="100%">
<tbody>
<tr class="table-row">
<td valign="top" width="60%">
<table border="0" cellpadding="4" cellspacing="" width="100%">
<tbody>
<tr>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;"><strong>Customer Name</strong> </span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">:</span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">[FIRST NAME] [LAST NAME]</span></td>
</tr>
<tr>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;"><strong>Customer Email</strong> </span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">:</span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">[EMAIL]</span></td>
</tr>
<tr>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;"><strong>Product Name</strong> </span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">:</span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">[PRODUCT NAME]</span></td>
</tr>
<tr>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;"><strong>Purchased On</strong> </span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">:</span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">[DATE]</span></td>
</tr>
<tr>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;"><strong>Return Reason</strong></span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">:</span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">[CUS NOTE]</span></td>
</tr>
<tr>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;"><strong>Repair ID</strong></span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">:</span></td>
<td><span class="text" style="color:#999999;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:150%;">[REPAIR ID]</span></td>
</tr>
</tbody>
</table>
</td>
<td align="center" width="40%" id="productimage"><img src="[PRODUCTIMAGE]" alt="img here" width="100%" height="250px" class="fr-fic fr-dii"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
I have a questions about how to loop through a html tab 'form' or 'Table Summary'.
The site : Visit https://mobile.uwants.com/forumdisplay.php?fid=631
I have tried below code but no luck
start_urls = ['https://mobile.uwants.com/forumdisplay.php?fid=631'])
def parse(self, response):
resp =response.xpath("//*[//*[#id='mainbody']/tbody/tr/td/div/table[2]/tbody/tr/td[1]/div[2]/form")
for r in resp:
r = response.xpath('//*[contains(#id,"thread_197")]/a/#href').extract_first()
yield response.follow(r,self.parse_items)
The first image is that this is my initial table that i would like the problem to loop through each comments
The second image is that this is one of the sample that i would like to scrap the comment
HTML Code
<form method="post" name="moderate" action="topicadmin.php?action=moderate&fid=631">
<input type="hidden" name="formhash" value="df27712a" />
<table summary="forum_631" cellspacing="0" cellpadding="0">
<thead class="category">
<tr>
<td class="folder"> </td>
<td class="icon"> </td>
<th>標題</th>
<td class="author">作者</td>
<td class="nums">回覆/查看</td>
<td class="lastpost">最後發表</td>
</tr>
</thead>
<tbody>
<tr>
<td class="folder"><img src="https://n2.hk/images/default/folder_common.gif" alt="announcement" /></td>
<td class="icon"> </td>
<th class="tsubject">論壇公告: 開戰準備!全新版區《Gundam Fan Club》開放!</th>
<td class="author">
<cite>mhmimi</cite>
<em>2017-6-9</em>
</td>
<td class="nums">-</td>
<td class="lastpost">-</td>
</tr>
</tbody>
<!-- Text T4 - Modified by Ivan - start-->
<tbody>
<tr>
<td colspan="6" height="35"><!-- Ad space:Uwants_Web_630_T4 --><script src="https://lv.l.networld.hk/lview?loc=_adb_20_10002834&callback=crystal2.addStaticSlot"></script>
</td>
</tr>
</tbody>
<!-- Text T4 - Modified by Ivan - end-->
<tbody id="stickthread_19434311" class="forumdisplay_thread" data-tid="19434311">
<tr>
<td class="folder"><img src="https://n2.hk/images/default/folder_lock.gif" /></td>
<td class="icon">
</td>
<th class="lock">
<label>
<img src="https://n2.hk/images/default/pin_2.gif" alt="分類置頂" />
<!-- By Rex Heat Thread -->
<!-- By Rex Heat Thread -->
</label>
<span id="thread_19434311" class="tsubject"><!-- google_ad_section_start -->請各會員注意,本版新措施(已生效)<!-- google_ad_section_end --></span>
</th>
<td class="author">
<cite>
Yue33695874
</cite>
<em></em>
</td>
<td class="nums">
<strong>0</strong> / <em>41262</em>
</td>
<td class="lastpost">
<em></em>
<cite>by Yue33695874 </cite>
</td>
</tr>
</tbody> <tbody id="stickthread_16031523" class="forumdisplay_thread" data-tid="16031523">
<tr>
<td class="folder"><img src="https://n2.hk/images/default/folder_lock.gif" /></td>
<td class="icon">
</td>
<th class="lock">
<label>
<img src="https://n2.hk/images/default/pin_2.gif" alt="分類置頂" />
<!-- By Rex Heat Thread -->
<!-- By Rex Heat Thread -->
</label>
<span id="thread_16031523" class="tsubject"><!-- google_ad_section_start -->==手機網絡 版版規== 本版嚴禁一切問價及報價, 違者發帖將被移走及不作通知!<!-- google_ad_section_end --></span>
</th>
<td class="author">
<cite>
quimboy1
</cite>
<em></em>
</td>
<td class="nums">
<strong>0</strong> / <em>61033</em>
</td>
<td class="lastpost">
<em></em>
<cite>by quimboy1 </cite>
</td>
</tr>
</tbody> <tbody id="stickthread_16776292" class="forumdisplay_thread" data-tid="16776292">
<tr>
<td class="folder"><img src="https://n2.hk/images/default/folder_lock.gif" /></td>
<td class="icon">
</td>
<th class="lock">
<label>
<img src="https://n2.hk/images/default/pin_1.gif" alt="本版置頂" />
<!-- By Rex Heat Thread -->
<!-- By Rex Heat Thread -->
</label>
<span id="thread_16776292" class="tsubject"><!-- google_ad_section_start -->溫馨提示 : 小心網上流動手提電話公司sales, 已經有騙案個案及已轉交警方處理<!-- google_ad_section_end --></span>
</th>
<td class="author">
<cite>
chungsm
</cite>
<em></em>
</td>
<td class="nums">
<strong>2</strong> / <em>65809</em>
</td>
<td class="lastpost">
<em></em>
<cite>by chungsm </cite>
</td>
</tr>
</tbody><!--
</table>
<table summary="forum_631" id="forum_631" cellspacing="0" cellpadding="0">
-->
手機網絡 - 熱門話題
</td></tr></tbody-->
<!--td class="folder" colspan="2"> </td-->
<td class="folder" ><img src="https://n2.hk/images/r09/hot_u.gif" /></td>
<td class="icon"> </td>
<th class="" >
<label>
<!-- By Rex Heat Thread -->
<!-- By Rex Heat Thread -->
</label>
<span id="thread_ht_1_19782731" class="tsubject">問 : 中國移動4.5G 網絡 地鐵接收如何</span>
New
Thanks for help guys
Try to change this line:
r = response.xpath('//*[contains(#id,"thread_197")]/a/#href').extract_first()
With this:
r = r.xpath('//*[contains(#id,"thread_197")]/a/#href').extract_first()
I think this is what you meant to do!
If you want to fetch all href contained in the table, you can do:
response.css('.tsubject a::attr(href)').extract()
Problem: td with image tag {{im.url}} shows images one below the other, but what I need is to show them side by side horizontally,
Is it possible to expand/merge that td to a size of first row so that I can put 5 images side by side ?
<tbody>
<tr *ngFor="let row of tasks; let i = index" colspan="6">
<td class="text-left" >
<b>
<u>{{row.lowtask}}</u>
</b>
<tr *ngFor="let t of row.time">
<td class="text-left">{{t.time1}}</td>
<td class="text-center">{{t.time2}}</td>
<td class="text-center">{{t.time3}}</td>
<td class="text-right">{{cnvert(t.cur1)}} </td>
<td class="text-right">{{convert(t.cur2)}} </td>
</tr>
<tr *ngFor="let im of row.images">
<td>
<img src="{{im.url}}" class="thumb"/>
</td>
</tr>
</td>
</tr>
</tbody>
You need to adjust your ngFor. Here you go:
<tbody>
<tr *ngFor="let row of tasks; let i = index" colspan="6">
<td class="text-left" >
<b>
<u>{{row.lowtask}}</u>
</b>
<tr *ngFor="let t of row.time">
<td class="text-left">{{t.time1}}</td>
<td class="text-center">{{t.time2}}</td>
<td class="text-center">{{t.time3}}</td>
<td class="text-right">{{cnvert(t.cur1)}} </td>
<td class="text-right">{{convert(t.cur2)}} </td>
</tr>
<tr>
<td *ngFor="let im of row.images">
<img src="{{im.url}}" class="thumb"/>
</td>
</tr>
</td>
</tr>
</tbody>
wrap your td in <ng-container>
<tbody>
<tr *ngFor="let row of tasks; let i = index" colspan="6">
<td class="text-left" >
<b>
<u>{{row.lowtask}}</u>
</b>
<tr *ngFor="let t of row.time">
<td class="text-left">{{t.time1}}</td>
<td class="text-center">{{t.time2}}</td>
<td class="text-center">{{t.time3}}</td>
<td class="text-right">{{cnvert(t.cur1)}} </td>
<td class="text-right">{{convert(t.cur2)}} </td>
</tr>
<tr>
<ng-container *ngFor="let im of row.images">
<td>
<img src="{{im.url}}" class="thumb"/>
</td>
</ng-container>
</tr>
</td>
</tr>
</tbody>
I have list which is featch from database on jsp like and i want to delete using checkbox with single row and multiple rows how to delete it with row id i have jsp code
<table id="example" class="table table-bordered table-striped dashboardtable" cellspacing="0" >
<thead class="thead">
<tr>
<th class="head" style="width:14%"><span>Serial Number</span></th>
<th class="head" ><span>Images List</span></th>
<th class="head"><span>Image Preview</span></th>
<th class="head" ><span>Email Id</span></th>
<th class="head" ><span>Sent Mail Time Span</span></th>
<th class="head" ><span>Resend Image</span></th>
<th></th>
<th class="head"><input type="checkbox" id="selecctall"/>Select All</th>
</tr>
</thead>
<tbody>
<c:forEach items="${emailImagesList}" var="al">
<tr>
<td style="width:14%">${al.serialNumber}</td>
<td >${al.mailImageName}</td>
<td><img src="<%=request.getContextPath()%>/emailImage/${al.id}/" height="100" width="150" ></td>
<td>${al.emailId} <img src="<%=request.getContextPath()%>/resources/images/edit.png" onclick="showpopup1('${al.id},${al.emailId}');"/></td>
<td>${al.mailSentTime}</td>
<td>Resend Image</td>
<td> <img onclick="javascript:exportToForm('${al.id}')" src="<%=request.getContextPath()%>/resources/images/delete.png" /></td>
<td><input class="checkbox1" type="checkbox" name="${al.id}"/><a href="#" onclick="javascript:deleteToForm('${al.id}')" >delete</a></td>
</tr>
</c:forEach>
and script is
function deleteToForm(id) {
var del = confirm("Press Ok to delete!");
if (del == true ) {
window.location="<%=request.getContextPath()%>/deleteImageByUser?id="+id
}
}
how to get all table list id and how it status is 0
There is a table alt text that uses CSS (by using inherit in CSS) to format its layout. As you can see there is a drop down on top of the window that allows us select names, and based on the selection, the table would be populated. This action has been handled by an Ajax call, so we only refresh the table and not the rest of the page. However, when we call this Ajax call, even though we don't have any change in the code, there would be an extra space between vertical and horizontal borders of this table. I assume that there is a problem with the Ajax call and the CSS layout that we have this extra spaces. Does it make sense? or Do you any place that I can start my investigations?
Here is the source code of my Test.jsp
<a:test-webpart>
<table class="ContentPanel first-child" cellspacing="0" cellpadding="0">
<tr>
<th id="title" class="CPHeader" width="100%" colspan="400" style="border-bottom:1px solid <theme:get selector="#test .DefaultBorder" attribute="border-color" />;"><c:out value="${tile_title}" /></th>
</tr>
<%# include file="MyTest.jst" %>
<tbody class="content-area">
<tr>
<td>
<table class="ContentPanel ControlLayout" >
<tr>
<th style="padding-left:7px;" width="20%"><label for="testlist"><span >*</span><fmt:message key = "jsp.request.testlist" bundle="${local}" /></label></th>
<td class="last-child" width="80%">
<span >
<html:select property="valueAsMap(test_ITEM).value(test_OFFER)" styleClass="dropDown" styleId="offeredtest">
<html:optionsCollection property="value(Item_test_LIST)" label = "name" value ="id" />
</html:select>
</span>
</td>
</tr>
<tr>
<th style="padding-left:7px;" width="20%"><label for="employeeslist"><span >*</span><fmt:message key = "jsp.reques.employeeslist" bundle="${local}" /></label></th>
<td class="last-child" width="80%" >
<span >
<html:select property="valueAsMap(test_ITEM).value(Item_test_EMP)" onchange="javascript:getAlltests()" styleClass="dropDown" styleId="employeeId">
<html:optionsCollection property="value(Item_test_EMP_LIST)" label = "name" value = "id" />
</html:select>
</span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<th style="padding-left:7px;" align="left"><label for="testacceptlist"><span >*</span><fmt:message key = "jsp.request.testacceptlist" bundle="${local}" /></label></th>
</tr>
<tr>
<td style="padding-left:7px;">
<kvl:rsr-webpart>
<div id="testsTable">
<table class="Tabular" width="100%" cellpadding="0" cellSpacing="0">
<tr class="first-child">
<th><fmt:message key = "jsp.request.select" bundle="${local}" /></th>
<th ><fmt:message key = "jsp.request.a" bundle="${local}" /></th>
<th ><fmt:message key = "jsp.request.b" bundle="${local}" /></th>
<th ><fmt:message key = "jsp.request.c" bundle="${local}" /></th>
<th ><fmt:message key = "jsp.request.d" bundle="${local}" /></th>
<th ><fmt:message key = "jsp.request.e" bundle="${local}" /></th>
<th ><fmt:message key = "jsp.request.f" bundle="${local}" /></th>
<th class="last-child"><fmt:message key = "jsp.request.job" bundle="${local}" /></th>
</tr>
<c:forEach var="item" items = "${items}" varStatus="status">
<tr class="<c:if test='${status.index % 2 != 0}'>Even</c:if> <c:if test='${item.isFromPrimaryJob == true}'>Primary</c:if> <c:if test='${item.isFromPrimaryJob != true}'>Exchange</c:if>">
<td>
<input type="checkbox"
id="test_id_<c:out value="${item.id}"/>_<c:out value="${item.Date}"/>"
name="value(test_selected)"
value="<c:out value="${item.id}" />_<c:out value="${item.Date}"/>"
onclick="javascript:checkBox('test_id_<c:out value="${item.id}"/>_<c:out value="${item.Date}"/>','value(test_selected)','valueAsMap(REQUEST_ITEM).value(test_selected_list)','false')" >
</td>
<td>
<c:choose>
<c:when test="${empty item.label}">
</c:when>
<c:otherwise>
<c:out value="${item.label}"/>
</c:otherwise>
</c:choose>
</td>
<td><c:out value="${item.Date}"/></td>
<td><c:out value="${item.b}"/></td>
<td><c:out value="${item.d}"/></td>
<td><c:out value="${item.e}"/></td>
<td><c:out value="${item.f}"/></td>
<td class="last-child"><c:out value="${item.job}"/></td>
</tr>
</c:forEach>
</table>
</div>
</kvl:rsr-webpart>
</td>
</tr>
<tr>
<td style="padding-left:7px;">
<table class="ContentPanel ControlLayout" width="100%">
<%# include file="request.jst" %>
</table>
</td>
</tr>
</tbody>
</table>
</a:test-webpart>
have a look at the generated HTML. just looking at the rendered stuff won't help except to something is wrong, not what. and just looking at the server code won't help as it uses magic and hides the HTML sometimes.
Later on I figured out that the problem has nothing to do with the any Ajax rendering. It was the return HTML tag that had these extra padding as it was inheriting its layout from another place. I enforced my padding and borderline along with cells that I was sending from server and everything worked like a charm.