网页打印页面上的完整边框

时间:2014-05-06 10:51:23

标签: c# javascript jquery html asp.net

我有一个网页和打印按钮。 当我点击该按钮时,我正在尝试打印该网页

这是我的按钮

<asp:ImageButton ID="ImageButton1" runat="server" ToolTip="Cancel" AlternateText="Print"
                ImageUrl="~/admin/images/print_btn.png" OnClientClick='javascript:window.print();' />

我的网页包含3个以上的打印页面。我在Media Print上设置了边框。 但它运作不正常。

最后一页只有一个底部边框。 我需要在每页打印上留下边框。

是否可以使用javascript或jquery? 如果可以使用c#,那么也让我知道

这是我的代码

<style type="text/css">
    @media print
    {
        .TblBorder
        {
            border-collapse: collapse;
            border: solid 1px black;
        }
        .TblBorder td
        {
            border: solid 1px black;
        }
        .TblBorder th
        {
            border: solid 1px black;
        }

    }
</style>
<table width="100%" cellpadding="8" cellspacing="2">
<tr class="printable">
    <td colspan="3" align="center" style="color: Black; font-family: Calibri; font-size: 18px;
        font-weight: bold">
        <asp:Label ID="lblHeading" runat="server" Text=""></asp:Label>
    </td>
</tr>
<tr class="non-printable" visible="false" runat="server" id="trPrintPlantandMachinery">
    <td colspan="3" align="left">
        <asp:LinkButton ID="lnkbtnPlantMachinery" runat="server" CssClass="left_panel" Text="<b>1. Download & Print  Plant & Machinery List</b>"
            OnClick="lnkbtnPlantMachinery_Click" Font-Underline="true"></asp:LinkButton>
    </td>
</tr>      
<tr class="printable">
    <td style="font-family: calibri; font-size: 14px; font-weight: bold; color: Black;"
        width="49%">
        Date of Visit the Enterprise
    </td>
    <td style="font-family: calibri; font-size: 14px; font-weight: bold; color: Black;"
        width="1%">
        :
    </td>
    <td width="50%" style="font-family: calibri; font-size: 15px; font-weight: bold;">
        <asp:Label ID="txtDateofVisit" runat="server"></asp:Label>
    </td>
</tr>
<tr class="printable">
    <td style="font-family: calibri; font-size: 14px; font-weight: bold; color: Black;"
        width="49%">
        Application Number
    </td>
    <td style="font-family: calibri; font-size: 14px; font-weight: bold; color: Black;"
        width="1%">
        :
    </td>
    <td width="50%" style="font-family: calibri; font-size: 15px; font-weight: bold;">
        <asp:Label ID="lblApplicationNo" runat="server" Text="-"></asp:Label>
    </td>
</tr>
<tr class="printable">
    <td width="49%" style="font-family: calibri; font-size: 14px; font-weight: bold;
        color: Black;">
        Scheme Name
    </td>
    <td width="1%" style="font-family: calibri; font-size: 14px; font-weight: bold; color: Black;">
        :
    </td>
    <td width="50%" style="font-family: calibri; font-size: 15px; font-weight: bold;">
        <asp:Label ID="lblSchemeName" runat="server"></asp:Label>
    </td>
</tr>
<tr class="printable">
    <td width="49%" style="font-family: calibri; font-size: 14px; font-weight: bold;
        color: Black;">
        Name of Enterprise
    </td>
    <td width="1%" style="font-family: calibri; font-size: 14px; font-weight: bold; color: Black;">
        :
    </td>
    <td width="50%" style="font-family: calibri; font-size: 15px; font-weight: bold;">
        <asp:Label ID="lblUnitName" runat="server" Text="-"></asp:Label>
    </td>
</tr>
<tr class="printable">
    <td width="49%" style="font-family: calibri; font-size: 14px; font-weight: bold;
        color: Black;">
        Enterprise Address
    </td>
    <td width="1%" style="font-family: calibri; font-size: 14px; font-weight: bold; color: Black;">
        :
    </td>
    <td width="50%" style="font-family: calibri; font-size: 15px; font-weight: bold;">
        <asp:Label ID="lblIndustryUnitAddress" runat="server" Text="-"></asp:Label>
    </td>
</tr>

</table>
<table width="100%" cellpadding="5" cellspacing="2" border="0">
<tr>
    <td style="font-family: calibri; font-size: 14px; font-weight: bold; color: Black;"
        width="49%">
        Constitution of The Unit
    </td>
    <td style="font-family: calibri; font-size: 14px; font-weight: bold; color: Black;"
        width="1%">
        :
    </td>
    <td width="50%" style="font-family: calibri; font-size: 15px; font-weight: bold;">
        <asp:Label ID="lblConstitutionUnit" runat="server" Text="-"></asp:Label>
    </td>
</tr>
<tr>
    <td style="font-family: calibri; font-size: 16px; font-weight: bold; color: Black"
        colspan="3">
        <u>Entrepreneur's Profile Details</u>
    </td>
</tr>


</table>

0 个答案:

没有答案