i have a table and i'm using datatables and its working without any colspan added to it..but when i try to add a colspan on the last column the filtering, searching and pagination are all not showing..how can i supposed to work it out.please help me..
here is my code
CSS
.table_wrapper{
margin-top:5px;
max-width:100%;
width:100%;
margin-bottom:60px;
overflow:hidden;
-webkit-box-shadow: 0 8px 30px -6px black;
-moz-box-shadow: 0 8px 30px -6px black;
box-shadow: 0 8px 30px -6px black;
border: 3px dashed red;
height:600px;
}
.datatables{
border-collapse:collapse;
margin-right: auto;
margin-left: auto;
font-size: 13px;
}
thead th{
background-color:#6a782a;
color:#FFF;
padding-left: 10px;
padding-right: 10px;
}
tbody td{
word-wrap: break-word;
}
HTML
<div class="table_wrapper">
<table class="datatables table-striped" width="100%">
<thead>
<tr>
<th>LHID</th>
<th>LO Name</th>
<th>Province</th>
<th>Municipality</th>
<th>Barangay</th>
<th>Title Number</th>
<th>Lot Number</th>
<th>Survey Number</th>
<th>Area</th>
<th>RLBET Action</th>
<th>Reasons</th>
<th colspan="2">Action</th>
</tr>
</thead>
<tbody>
<?php
//$query = "SELECT * FROM login";
echo $LTID->viewdetails();
?>
</tbody>
</table>
</div>
Related
hi I am using dompdf for generating pdf from HTML but not able to understand why it gets break while printing the pdf
here is my function
public function printRunsheetBymanifestAction()
{
$manifestId = $this->params()->fromRoute('id', 0);
$getDetails = $this->getDeliveryTable()->getRunSheetData(array('manifestId' => base64_decode($manifestId)));
$getItemDetails = $this->getManifestTable()->getManifestItemsById($getDetails[0]['manifestId']);
$options = new Options();
$options->set('isRemoteEnabled', true);
$options->set('defaultFont','Courier');
$options->set('defaultPaperSize','A4');
$domPdf = new \Dompdf\Dompdf($options);
$domPdf->set_option('isHtml5ParserEnabled', true);
$view = $this->getServiceLocator()->get('ViewRenderer');
$viewModel = new ViewModel();
$viewModel->setTemplate('delivery/index/print-runsheet-bymanifest.phtml');
$viewModel->setVariable('results', $getDetails);
$viewModel->setVariable('itemDetails', $getItemDetails);
$content = $view->render($viewModel); //make html content for loadn in doampdf
$domPdf->loadHtml($content);
$domPdf->render();
$fileName = $getDetails[0]['runsheetNumber'].'_'.date('d_m_Y');
$domPdf->stream($fileName,array("Attachment"=>1));
exit;
}
here is my phtml template even I try the page break CSS for break the page after desired output
<?php $results = $this->results;
$items = $this->itemDetails;
?>
<style>
table.body {
width: 100%;
margin: 0 auto;
}
td.text-right{text-align: right;}
td.text-center{text-align: center;}
.page_breack{
clear: both;
page-break-after: always;
}
</style>
<table class="body" align="center" style="border-top: 1px solid #333; border-left: 1px solid #333; border-right: 1px solid #333;">
<tr>
<td>
<div id="header">
<table style="width: 100%; border-collapse: collapse;">
<tr>
<td style="width: 30%">
<img style="width: 250px" src="<?=$this->basePath();?>/manifests/generate-barcode/<?php echo $results[0]['runsheetNumber']; ?>">
</td>
<td style="width: 70%">
<table class="row" style="width: 100%">
<tr>
<td >Location: <?php echo $results[0]['branchName']; ?></td>
</tr>
<tr>
<td >Website: www.xfas.in</td>
</tr>
<tr>
<td >
Daily Runsheet for : <?php echo $results[0]['allocated'.$results[0]['allocatedTo'].'Code'].' - '.$results[0]['allocated'.$results[0]['allocatedTo'].'Name']; ?>
</td>
</tr>
<tr>
<td class="text-right">
<strong>Printed # : <?php echo date('d.m.Y'); ?></strong>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<table width="100%" style="border-collapse: collapse;">
<tr>
<th style="border-bottom: 2px dashed #333; border-top:2px dashed #333; text-align: center; height: 15px; ">SNo.</th>
<th style="border-bottom: 2px dashed #333; border-top:2px dashed #333; text-align: center; height: 15px; ">AwbNo.</th>
<th style="border-bottom: 2px dashed #333; border-top:2px dashed #333; text-align: center; height: 15px; ">Consignee Details</th>
<th style="border-bottom: 2px dashed #333; border-top:2px dashed #333; text-align: center; height: 15px; ">Pin Code</th>
<th style="border-bottom: 2px dashed #333; border-top:2px dashed #333; text-align: center; height: 15px; ">Signature</th>
</tr>
<?php if(count($items) > 0):
foreach ($items as $key => $val):
// $key = $key +1;
?>
<tr class="<?php
++$key;
if($key%14 == 0 && $key !=0)
echo "page_breack";
//echo ++$key; ?>" ><td style="font-size: 12px; text-align:center; height: 65px; border-bottom: 1px solid #333; border-top:1px solid #333; border-collapse: collapse;"><?php echo $key; ?></td>
<td style="font-size: 12px; text-align:center; height: 65px; border-bottom: 1px solid #333; border-top:1px solid #333; border-collapse: collapse;"><?php echo $val['Awb']; ?></td>
<td style="font-size: 12px; text-align:center; height: 65px; border-bottom: 1px solid #333; border-top:1px solid #333; border-collapse: collapse;"><strong><?php echo $val['Consignee']; ?></strong><br>
<?php echo $val['Address'].', '.$val['Place'].', '.$val['ConsigneeArea']; ?>
</td>
<td style="font-size: 12px; text-align:center; height: 65px; border-bottom: 1px solid #333; border-top:1px solid #333; border-collapse: collapse;"><?php echo $val['PinCode']; ?></td>
<td style="font-size: 12px; text-align:center; height: 65px; border-bottom: 1px solid #333; border-top:1px solid #333; border-collapse: collapse;"></td>
</tr>
<?php endforeach; ?>
<?php
$ramainRow = count($items)%14;
if($ramainRow >0){
// $cnt = 14 - count($items);
for ($i =0; $i < $ramainRow; $i++){?>
<tr>
<td colspan="5" style="font-size: 12px; text-align:center; height: 65px; border-bottom: 1px solid #333; border-top:1px solid #333; border-collapse: collapse;"></td>
</tr>
<?php } ?>
<tr>
<td colspan="5" style="font-size: 12px; text-align:center; height: 53px; border-bottom: 1px solid #333; border-top:1px solid #333; border-collapse: collapse;">
<strong>Receiver Name:</strong> <?php echo $results[0]['allocated'.$results[0]['allocatedTo'].'Code'].' - '.$results[0]['allocated'.$results[0]['allocatedTo'].'Name']; ?><br>
<strong>Signature:</strong>
</td>
</tr>
<?php }?>
<?php endif;?>
</table>
</td>
</tr>
above is the htm fiel file for better understanding i am givig the pdf fil
DOMPDF creating blank page at the start of document in laravel. I have chacked all html cotent there is no spaces. anybody has suggestion?
Below is code which I am trying to fit into a pdf file using DOMPDF
<div class="invoice printableArea" style="color: #333333; font: 12px Verdana; padding: 0; margin: 0;">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main-table"
style="height: 100%;margin-top: 0;">
<tr>
<td align="center" style="width: 100%; height: 100%;">
<table cellpadding="0" cellspacing="0" border="0"
style=" width: 100%; table-layout: fixed; margin: 0px;">
<tr>
<td style=" border: 1px solid #e6e6e6; margin: 0px auto 0px auto; padding: 20px; text-align: left;">
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin:0;">
<tr>
<td style="padding:0px 0px 0px 0px;">
<img src="" width="150" height="45" alt=""/></td>
</tr>
</table>
<table cellpadding="0" cellspacing="5" border="0" width="100%" style="border: 1px solid #e6e6e6; padding:0;margin-top:10px;">
<tr valign="top">
<td style="padding: 15px;">
<h2 style="margin: 0px 0px 10px 0px;">Invoice #</h2>
<table style="float:left;border:none;margin:0;" >
<tbody>
<tr>
<td style="padding: 5px;text-align: right;">Invoice Date : </td>
<td style="padding: 5px;text-align: right;"> </td>
</tr>
<tr>
<td style="padding: 5px;text-align: right;"><span>Payment Method : </span></td>
<td style="padding: 5px;text-align: right;"></td>
</tr>
<tr>
<td style="padding: 5px;text-align: right;"><span>Shipping Method : </span></td>
<td style="padding: 5px;text-align: right;"></td>
</tr>
</tbody>
</table>
</td>
<td style="padding: 30px 0px 0px 0px;text-align: center;">
<div id="invoiceBarcodeTarget"></div>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="5" border="0" width="100%"
style="padding:20px 0px;">
<tr valign="top">
<td width="34%"
style="padding:10px;">
<h3 style=" padding: 0px 0px 3px 1px; margin: 0px;">Billing Address : </h3>
<p style="margin: 2px 0px 3px 0px;">
<strong></strong> </p>
<p style="margin: 2px 0px 3px 0px;">
<br/></p>
<p style="margin: 2px 0px 3px 0px;">
</p>
<p style="margin: 2px 0px 3px 0px;">
</p>
<p style="margin: 2px 0px 3px 0px;">
<i title="Phone" class="fa fa-phone-square"></i>
<br/>
<i title="Phone" class="fa fa-phone-square"></i>
#endif
</p>
</td>
<td width="33%" style="padding:10px;">
<h3 style=" padding: 0px 0px 3px 1px; margin: 0px;">Shipping Address : </h3>
<p style="margin: 2px 0px 3px 0px;">
<strong></strong> </p>
<p style="margin: 2px 0px 3px 0px;">
<br/></p>
<p style="margin: 2px 0px 3px 0px;">
</p>
<p style="margin: 2px 0px 3px 0px;">
</p>
<p style="margin: 2px 0px 3px 0px;">
<i title="Phone" class="fa fa-phone-square"></i>
</p>
#endif
</td>
</tr>
</table>
<table class="" style="background-color: #dddddd;border: 1px solid #e6e6e6;margin:0;">
<tr>
<th style="background-color: #f9f9f9; padding: 6px 10px; white-space: nowrap;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; "><strong class="text-center">Sr. No.</strong></th>
<th style="background-color: #f9f9f9; padding: 6px 10px; white-space: nowrap;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
Product
</th>
<th style="background-color: #f9f9f9; padding: 6px 10px; white-space: nowrap;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
Unit price
</th>
<th style="background-color: #f9f9f9; padding: 6px 10px; white-space: nowrap;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
Discount
</th>
<th style="background-color: #f9f9f9; padding: 6px 10px; white-space: nowrap;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
Quantity
</th>
<th style="background-color: #f9f9f9; padding: 6px 10px; white-space: nowrap;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
Subtotal
</th>
</tr>
<tbody>
<tr>
<td style="padding: 5px 10px; background-color: #ffffff;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6;text-align: center; ">{{$i}}</td>
<td style="padding: 5px 10px; background-color: #ffffff;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6;text-align: left; ">
<b>{{#$product_detail['title']}} </b> <br />
<b>Seller : </b> {{#$product_detail['store_name']}}
</td>
<td style="padding: 5px 10px; background-color: #ffffff; text-align: center;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
<span><span class="WebRupee">₹</span>{{ number_format(#$product['price'], 2) }}</span>
</td>
<td style="padding: 5px 10px; background-color: #ffffff; text-align: center;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
<span><span class="WebRupee">₹</span>0.00</span>
</td>
<td style="padding: 5px 10px; background-color: #ffffff; text-align: right;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
{{#$product['quantity']}}
</td>
<td style="padding: 5px 10px; background-color: #ffffff; text-align: right;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
<span><span class="WebRupee">₹</span>{{ number_format(#$product['price']*$product['quantity'], 2) }}</span>
</td>
</tr> </tbody>
</table>
<table class="" style="background-color: #dddddd;border: 1px solid #e6e6e6;margin:0;">
<tr>
<th style="background-color: #f9f9f9; padding: 6px 10px; white-space: nowrap;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; "><strong class="text-center">Sr. No.</strong></th>
<th style="background-color: #f9f9f9; padding: 6px 10px; white-space: nowrap;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
Product
</th>
<th style="background-color: #f9f9f9; padding: 6px 10px; white-space: nowrap;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
Unit price
</th>
<th style="background-color: #f9f9f9; padding: 6px 10px; white-space: nowrap;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
Discount
</th>
<th style="background-color: #f9f9f9; padding: 6px 10px; white-space: nowrap;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
Quantity
</th>
<th style="background-color: #f9f9f9; padding: 6px 10px; white-space: nowrap;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
Delivery Address
</th>
<th style="background-color: #f9f9f9; padding: 6px 10px; white-space: nowrap;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
Subtotal
</th>
</tr>
<tbody><tr>
<td style="padding: 5px 10px; background-color: #ffffff;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6;text-align: center; ">{{$i}}</td>
<td style="padding: 5px 10px; background-color: #ffffff;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6;text-align: left; ">
<b>{{#$product_detail['title']}} </b> <br />
<b>Seller : </b> {{#$product_detail['store_name']}}
</td>
<td style="padding: 5px 10px; background-color: #ffffff; text-align: center;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
<span><span class="WebRupee">₹</span></span>
</td>
<td style="padding: 5px 10px; background-color: #ffffff; text-align: center;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
<span><span class="WebRupee">₹</span>0.00</span>
</td>
<td style="padding: 5px 10px; background-color: #ffffff; text-align: right;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
1
</td>
<td style="padding: 5px 10px; background-color: #ffffff; text-align: right;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
<span style="text-align:left;float:left;">
</span>
</td>
<td style="padding: 5px 10px; background-color: #ffffff; text-align: right;border-right: 1px solid #e6e6e6;border-top: 1px solid #e6e6e6; ">
<span><span class="WebRupee">₹</span>{{ number_format(#$product['price'], 2) }}</span>
</td>
</tr>
<?php $i++; ?>
#endforeach
#else
<tr>
<td colspan="100%">
{{trans('messages.error.order.order_product.empty')}}
</td>
</tr>
#endif
</tbody>
</table>
#endif
<table style="width:35%;float:right;border:none;" >
<tbody>
<tr>
<td style="padding: 5px;text-align: right;">Subtotal : </td>
<td style="font-weight: bold;padding: 5px;text-align: right;"><span><span class="WebRupee">₹</span>{{ number_format(#$invoiceData['invoice']['subtotal'], 2) }}</span></td>
</tr>
<tr>
<td style="padding: 5px;text-align: right;"><span>Order Discount (-) : </span></td>
<td style="font-weight: bold;padding: 5px;text-align: right;"><span><span class="WebRupee">₹</span>00.00</span></td>
</tr>
<tr>
<td style="padding: 5px;text-align: right;"><span>Price After Discount : </span></td>
<td style="font-weight: bold;padding: 5px;text-align: right;"><span><span class="WebRupee">₹</span>{{ number_format(#$invoiceData['invoice']['total'], 2) }}</span></td>
</tr>
<tr>
<td style="padding: 5px;text-align: right;"><span>Shipping Cost : </span></td>
<td style="font-weight: bold;padding: 5px;text-align: right;"><span><span class="WebRupee">₹</span>{{ number_format(#$invoiceData['invoice']['shipping_cost'], 2) }}</span></td>
</tr>
<tr>
<td style="padding: 5px;text-align: right;"><span>Grand Total : </span></td>
<td style="font-weight: bold;padding: 5px;text-align: right;"><span><span class="WebRupee">₹</span>{{ number_format(#$invoiceData['invoice']['total'], 2) }}</span></td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
Three things:
1) Nested tables. Generally fine, but your outer table is just a container for the inner table. dompdf is currently unable to break an individual table cell across pages (#98) so this will cause you all kinds of grief. If you have styling on that table that you want to apply (e.g. a border) use a div instead.
2) The height: 100%; styling. Avoid this if you can on elements that are the direct child of the body. dompdf's height calculation can sometimes be off by a bit, causing paging on an element with 100% of the body height.
3) The height: 100%; styling, part 2. The height probably won't be what you expect since dompdf (and by default web browsers) determine height by the content area not the containing box. Margin and padding will further expand the element's height unless everything is specifically set to 0. At least until dompdf supports the box-sizing declaration.
This code works prefect on browsers but problem is that when i fill dynamic data and generating PDF using dompdf then <td>item</td> full column goes top on cell.
What is the solution ?
Browsers shows like this Browsers View but Generated PDF by dom pdf shows like this Generated PDF View
body {
font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
}
#header { position: fixed; left: 0px; width:100%; bottom: -150px; right: 0px; height: 150px; background-color: #4b94d9; color:#000; text-align: left; }
#page-wrap {
width: 700px;
margin: 0 auto;
}
.center-justified {
text-align: justify;
margin: 0 auto;
width: 30em;
}
table.outline-table {
border: 1px solid;
border-spacing: 0;
}
tr.border-bottom td, td.border-bottom {
border-bottom: 1px solid;
}
tr.border-top td, td.border-top {
border-top: 1px solid;
}
tr.border-right td, td.border-right {
border-right: 1px solid;
}
tr.border-right td:last-child {
border-right: 0px;
}
tr.center td.center {
text-align: center;
valign:"middle";
}
td.pad-left {
padding-left: 5px;
line-height: 2;
}
tr.right-center td, td.right-center {
text-align: right;
padding-right: 50px;
}
tr.right td, td.right {
text-align: right;
}
.content > div > span{
display:inline-block;
width:50%; /* or choose some other value */
}
.contentdate > div > span{
display:inline-block;
width:35%; /* or choose some other value */
}
<table width="100%" class="outline-table">
<tbody>
<tr class="border-bottom border-right" style="background:#353940;color:#FFF;">
<td width="35%" class="pad-left"><strong>Item</strong></td>
<td width="10%" style="text-align:center;"><strong>Quantity</strong></td>
<td width="10%" class="right"><strong>Unit Cost</strong></td>
<td width="15%" class="right"><strong>Total</strong></td>
</tr>
<tr class="border-right">
<td class="pad-left">some item name one</td>
<td style="text-align:center;">15</td>
<td class="right">1500.00</td>
<td class="right">22500.00</td>
</tr>
</tbody>
</table>
This code works prefect on browsers but problem is that when i fill dynamic data and generating PDF using dompdf then <td>item</td> full column goes top on cell.
What is the solution ?
Try This.
td.pad-left {
padding-left: 5px;
//line-height: 2; <--remove this
}
Html
<tr class="border-right">
<!-- give margin top in particular line -->
<td class="pad-left"><p style="margin-top:10px;">some item name one</p></td>
<td style="text-align:center;">15</td>
<td class="right">1500.00</td>
<td class="right">22500.00</td>
</tr>
I want to show certain <div> on a certain <td> of a table. Here is what I'm trying in HTML:
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="10%" valign="middle">{$avatar}{$change_avatar}</td>
<td class="trow1" width="90%" valign="top">
{$online_status}<span class="largetext"><strong>{$formattedname}</strong></span>
<div class="smalltext">{$groupimage}</div>
</td>
</tr>
</table>
On this code, I've this:
$change_avatar = '<div class="change_avatar">Change Avatar</div>';
I want to show {$change_avatar} on mouse hover when mouse comes over to the first <td> of the table, code I showed above.
Here is CSS I used;
.change_avatar{
display: none;
font-size: 11px;
background: #363737;
color: #FFF;
opacity: 0.8;
border-radius: 2px;
padding: 3px 5px;
}
.change_avatar a:link, .change_avatar a:visited, .change_avatar a:active{
color: #FFF !important;
text-decoration: none;
}
td:hover .change_avatar{
display: inline;
margin-top: 50px;
margin-left: -70px;
position: absolute;
}
Please help.
Try this:
CSS:
.change_avatar{
display: none;
font-size: 11px;
background: #363737;
color: #FFF;
opacity: 0.8;
border-radius: 2px;
padding: 3px 5px;
}
.change_avatar a:link, .change_avatar a:visited, .change_avatar a:active{
color: #FFF !important;
text-decoration: none;
}
td #change_avatar:hover .change_avatar{
display: inline;
margin-top: 50px;
margin-left: -70px;
position: absolute;
}
HTML:
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="10%" valign="middle" id="change_avatar">{$avatar}{$change_avatar}</td>
<td class="trow1" width="90%" valign="top">
{$online_status}<span class="largetext"><strong>{$formattedname}</strong></span>
<div class="smalltext">{$groupimage}</div>
</td>
</tr>
</table>
you can use JQuery to achieve this. e.g. you td have id="avatarTD"
$("#avatarTD").mouseover(function(){
$(".change_avatar").show();
});
$("#avatarTD").mouseout(function(){
$(".change_avatar").hide();
});
I am using PHP to send mail of a webpage content. I have a table in the page.
My table does not show row and column borders in email sent using PHP mail.
It does not read the CSS in email.
This is my code:
<div id="table_email" style="width:800px;margin-left:50px; text-align: left;">
<table class="table1">
<tr>
<th>Description</th>
<th colspan="2">Amount</th>
</tr>
<tr>
<td>(A)Package Cost</td>
<td>';$formatedMessag .= $inv[0].'</td>
</tr>
<tr>
<td>(B) Insurance </td>
<td>';$formatedMessag .= $inv[1].'</td>
</tr>
<tr>
<td>(C)Flight / Train</td>
<td>';$formatedMessag .= $inv[2].'</td>
</tr>
<tr>
<td>Add : Service Tax 3% on Rs.(a+b)</td>
<td>';$formatedMessag .=$inv[5].'</td>
</tr>
<tr>
<td>Add : Educational Cess 2% On 3% </td>
<td>';$formatedMessag .= $inv[6].'</td>
</tr>
<tr>
<td>Add : Secondary& Higher Education Cess 1% on 3% </td>
<td>';$formatedMessag .= $inv[7].'</td>
</tr>
<tr style=" font-weight: bold;font-size: 12px;background-color:seashell;">
<td>Total Payable Amount</td>
<td>';$formatedMessag .='INR ' . $inv[9].'</td>
</tr>
';$formatedMessag .='
</table>
</div>
This is my CSS:
.table1{
width: 990px;
margin-left: 5px;
border: 1px solid #CDCDCD;
}
.table1 th{
background: none repeat scroll 0 0 #EEEEEE;
padding: 10px;
font-size: 11px;
color: #777777;
border: 1px solid #CDCDCD;
}
.table1 tr{
padding: 10px;
font-size: 11px;
height: 30px;
border: 1px solid #CDCDCD;
}
.table1 tr td:first-child{
font-weight: bold;
text-align: left;
border: 1px solid #CDCDCD;
}
.table1 td{
padding-left: 3px;
border: 1px solid #CDCDCD;
color: #333333;
}
This is because when you sent a mail it can't access the style class,
Instead of this <table class="table1"> use inline css like:
<table style='width: 990px; etc;'>.