<div id='studentPhoTable'>
<table class="table table-border table-bordered table-hover table-bg table-sort">
<tbody>
<asp:Repeater ID="rptlist" runat="server">
<ItemTemplate>
<tr>
<td colspan="4" style="padding-top: 66px;"></td>
</tr>
<tr>
<td colspan="4" align="center">
<h1><strong>交货单</strong><strong></strong></h1>
</td>
</tr>
<tr>
<td colspan="2">社区:<%#Eval("xiaoqu_name") %></td>
<td colspan="2">商品数量:<%#Eval("pcount")%></td>
</tr>
<tr>
<td colspan="2">团长姓名:<%#Eval("name") %></td>
<td colspan="2">团长电话:<%#Eval("mobilePhone") %></td>
</tr>
<tr>
<td colspan="4">地址:<%#Eval("address") %></td>
</tr>
<tr>
<td><strong>序号</strong></td>
<td><strong>商品分类</strong></td>
<td><strong>商品名称</strong></td>
<td><strong>数量</strong></td>
</tr>
<asp:Repeater ID="rpta" runat="server">
<ItemTemplate>
<tr>
<td><%#Container.ItemIndex+1 %></td>
<td><%#Eval("fenLei_name") %></td>
<td><%#Eval("product_Name") %></td>
<td><%#Eval("procount") %></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
</tbody>
</table>
</div>
<input type="button" οnclick="print()" value="确定打印" class="btn btn-primary radius" />
<script type="text/javascript">
function print() {
var divToPrint = document.getElementById('studentPhoTable');
var htmlToPrint = '' +
'<style type="text/css">' +
'table {' +
'border-right:1px solid #000;' +
'border-bottom:1px solid #000;' +
' width:700px;' + //控制打开在A4纸上的宽度
'}' +
'table td{' +
'border-left:1px solid #000;' +
'border-top:1px solid #000' +
'}' +
'#box > table:nth-child(3){' +
'width:1505px;' +
'height:143px;' +
'margin-bottom: 20px;' +
'}' +
'#box > table:nth-child(4){' +
'width:1505px;' +
'height:143px;' +
'margin-bottom: 20px;' +
'}' +
'#box > table:nth-child(5){' +
'width:1505px;' +
'height:143px;' +
'margin-bottom: 20px;' +
'}' +
'#box > table:nth-child(6){' +
'width:1505px;' +
'height:143px;' +
'margin-bottom: 20px;' +
'}' +
'#box > p.text-center > span{' +
'position: relative;' +
'left: 50%;' +
'}' +
'#box > p.clearfix.order-title > span.pull-left.order-num{' +
'position: relative;' +
'right: -78%;' +
'}' +
'#box > p.clearfix.order-title > span.pull-left.partment{' +
'position: relative;' +
'left: 2%;' +
'}' +
'</style>';
htmlToPrint += divToPrint.outerHTML;
newWin = window.open("");
newWin.document.write(htmlToPrint);
newWin.print();
newWin.close();
}
</script>