gpt4 book ai didi

html - 当打印多于一页时,它会在两页之间打断表格

转载 作者:行者123 更新时间:2023-11-28 19:08:36 25 4
gpt4 key购买 nike

我的页面有问题,因为它比一页长,它会破坏表格,所以它会分两页打印。我需要阻止这种情况发生,但我不知道该怎么做。我试过了

table { page-break-inside:auto }
tr { page-break-inside:avoid; page-break-after:auto }

我在这里的另一个问题中看到了这一点,但到目前为止还没有运气。

我在 IE7 上工作,但它必须主要在 IE6、IE7、IE8 上工作,如果可能的话还得在其他上工作。

有什么建议吗?

非常感谢。


CSS

    /*Universal selector:
This rule set will be applied to every element in a document:*/
*
{
margin:auto;
padding:auto;
/*text-align:center;*/
font-size:1em;
}

/*The folowing rule will help to minimaze the differences between browesers*/
h1,h2,h3,h4,h5,h6,pre,code,address,caption,cite,code,em,strong,th {font-weight:normal; font-style:normal;}
ul,ol {list-style:none;}
img {border:none;}
caption,th {text-align:left;}

table {
border-spacing:0;
font-size:1em;
font-weight:normal;
font-style:normal;
font-family:Times New Roman;
page-break-inside:avoid;

}
tr{
page-break-inside:avoid;
page-break-after:auto
}

.divTitle{
margin:10px;
}
}
.title
{
font-weight:bold;
color:#0076BF;
font-size:1.4em;
font-family:Times New Roman;
}

.divContainer
{
margin:10px;
background-color:#C7D8EE;
border:2px solid #0076BF;
text-align:left;
overflow:visible;
}

.tableContainer
{
color:#0076BF;
margin: -10px 0px -10px 0px;
border-spacing: 10px;
empty-cells:show;
width:90%;

}

.tableContainer tr td{
white-space:nowrap;
}

.tableContainerRow2{
background-color:white;
border:2px solid #0076BF;

}

.divBlueBarTitle{
margin:15px 10px -7px 10px;

background-color:#0076BF;
}
.divBlueBarTitle font{
font-size:1.2em;
font-family:Times New Roman;
font-weight:bold;
color:white;
text-indent:10px;
}
.divContainerWhite
{
margin:15px 10px 0px 10px;
background-color:white;
text-align:left;


}
.tableContainerWhite
{
color:#0076BF;
margin: 0px 0px 0px -10px;
border-spacing: 10px;
width:90%;

}

.tableContainerWhite td{
white-space:nowrap;
}


.footer {
margin-top:40px;
padding-bottom:20px;
font-family: Arial, Helvetica, sans-serif;
color: #303030;
line-height: normal;
font-size:smaller;
text-align:right;
width:95%;
}

HTML

  <body>
<div class="divTitle">
<font class="title"> Maternity Diary Event</font>
</div>
<!--Maternity Diary Event-->
<div class="divContainer">
<table class="tableContainer" cellspacing="10px">
<tr>
<td>NHS Number</td>
<td>&#160;</td>
<td>Date of Visit</td>
<td>&#160;</td>
<td colspan="3">Care Time Started</td>
<td>&#160;</td>
<td>&#160;</td>
<td rowspan="2" style="font-weight:bold;vertical-align:middle;">Tick when<br/> care starts</td>
</tr>
<tr >
<td width="90" class="tableContainerRow2">&#160;
<xsl:value-of select="//MaternityDiaryEvent/NHSNumber"/>
</td>
<td >&#160;</td>
<td width="80" class="tableContainerRow2">&#160;12/12/09</td>
<td >&#160;</td>
<td width="40" class="tableContainerRow2">&#160;12</td>
<td width="5">:</td>
<td width="40" class="tableContainerRow2">&#160;10</td>
<td >&#160;</td>
<td style="text-align:right" >&#160;&#9745;</td>
</tr>
</table>
<table class="tableContainer" cellspacing="10px" >
<tr>
<td></td>
<td>Initials</td>
<td>Surname</td>
</tr>
<tr>
<td width="80" style="font-weight:bold;">Midwife</td>
<td width="50" class="tableContainerRow2">&#160;</td>
<td class="tableContainerRow2">&#160;</td>
</tr>
<tr>
<td></td>
<td>Initials</td>
<td>Surname</td>
</tr>
<tr>
<td style="font-weight:bold;">Doctor</td>
<td class="tableContainerRow2">&#160;</td>
<td class="tableContainerRow2">&#160;</td>
</tr>
</table>
<table class="tableContainer" cellspacing="10px" >
<tr>
<td width="250">Forename</td>
<td>Surname</td>
</tr>
<tr>
<td class="tableContainerRow2">&#160;</td>
<td class="tableContainerRow2">&#160;</td>
</tr>
</table>
<table class="tableContainer" cellspacing="10px" style="margin-bottom:10px;" >
<tr>
<td width="90">Date of Birth</td>
<td width="150"></td>
<td width="100">Casenote No:</td>
<td></td>
</tr>
<tr>
<td class="tableContainerRow2">&#160;</td>
<td></td>
<td class="tableContainerRow2">&#160;</td>
<td></td>
</tr>
</table>
</div>
<!--Site Visit-->
<div class="divBlueBarTitle">
<font>SITE VISIT</font>
</div>
<div class="divContainer">
<table class="tableContainer" cellspacing="10px" style="margin-bottom:10px;">
<tr>
<td>Home</td>
<td>&#160;&#9745;</td>
<td>Blake Maty Centre</td>
<td>&#160;&#9745;</td>
<td>&#160;</td>
<td>&#160;</td>
</tr>
<tr>
<td>Consultant ANC</td>
<td>&#160;&#9745;</td>
<td>Grange Maty Centre</td>
<td>&#160;&#9745;</td>
<td>&#160;</td>
<td>&#160;</td>
</tr>
<tr>
<td>Midwifery ANC</td>
<td>&#160;&#9745;</td>
<td>MRMC/B5</td>
<td>&#160;&#9745;</td>
<td></td>
<td></td>
</tr>
<tr>
<td>Day assessment Unit</td>
<td>&#160;&#9745;</td>
<td>Ports Maty Centre SMH</td>
<td>&#160;&#9745;</td>
<td></td>
<td></td>
</tr>
<tr>
<td>Labour Ward</td>
<td>&#160;&#9745;</td>
<td>Posnatal Ward</td>
<td>&#160;&#9745;</td>
<td></td>
<td></td>
</tr>
<tr>
<td>Antenatal Ward</td>
<td>&#160;&#9745;</td>
<td>Telephone Assessment</td>
<td>&#160;&#9745;</td>
<td>Other(give reason below)</td>
<td>&#160;&#9745;</td>
</tr>
<tr>
<td class="tableContainerRow2" colspan="6" rowspan="2">&#160;</td>
</tr>
</table>
</div>
<div class="divContainerWhite">
<table class="tableContainerWhite" cellspacing="10px" style="font-size:1.1em;">
<tr>
<td style="text-decoration:underline;font-weight:bold;white-space:nowrap;">Reason for Contact Booking:</td>
<td>&#160;</td>
<td width="150" style="font-weight:bold;">Gestation:&#160;Weeks:</td>
<td width="30" class="tableContainerRow2">&#160;</td>
<td width="50" style="font-weight:bold;">Days:</td>
<td width="30" class="tableContainerRow2">&#160;</td>
<td >&#160;</td>
</tr>
</table>
<table class="tableContainerWhite" cellspacing="10px">
<tr>
<td >Choice of Birth Offered</td>
<td>&#160;&#9745;</td>
<td >Domestic Violence Identified</td>
<td>&#160;&#9745;</td>
<td >Late Booker (&gt;&#160;11Wks&#160;6&#160;Days)</td>
<td>&#160;&#9745;</td>
</tr>
<tr>
<td style="white-space:nowrap">Contact Number Provided</td>
<td>&#160;&#9745;</td>
<td style="white-space:nowrap">Safeguarding Children identified</td>
<td>&#160;&#9745;</td>
<td>&#160;</td>
<td>&#160;</td>
</tr>
</table>
</div>
<div class="divContainer">
<table class="tableContainer" cellspacing="10px">
<tr>
<td colspan="4" style="font-size:1.1em;text-decoration:underline;font-weight:bold;">Reason For Late Booking</td>
</tr>
<tr>
<td width="200">Woman booked herself late</td>
<td>&#160;&#9745;</td>
<td colspan="4" style="white-space:nowrap;">&#160;&#9745;&#160;Other (give reason below)</td>

</tr>
<tr>
<td>Recently moved to area</td>
<td>&#160;&#9745;</td>
<td rowspan="3" colspan="5" class="tableContainerRow2" >&#160;</td>
</tr>
<tr>
<td>Transferred from another hospital</td>
<td>&#160;&#9745;</td>
</tr>
<tr>
<td>Late booking by Midwife</td>
<td>&#160;&#9745;</td>

</tr>
<tr>
<td>Intrapartum</td>
<td>&#160;&#9745;</td>
<td>Posnatal Admission</td>
<td colspan="4">&#160;&#9745;</td>

</tr>
<tr>
<td>Antenatal Admision</td>
<td>&#160;&#9745;</td>
<td>Intrauterine Transfer</td>
<td colspan="4">&#160;&#9745;</td>
</tr>
<tr>
<td >Antenatal Check Routine</td>
<td >&#160;&#9745;</td>
<td style="white-space:nowrap;font-weight:bold;">Gestation:&#160;Weeks:</td>
<td width="30" class="tableContainerRow2">&#160;</td>
<td style="font-weight:bold;">Days:</td>
<td width="30" class="tableContainerRow2">&#160;</td>
<td >&#160;</td>
</tr>
<tr>
<td>Postnatal Check Routine</td>
<td>&#160;&#9745;</td>
<td colspan="2">Postnatal Check Other</td>
<td>&#160;&#9745;</td>
<td>Day</td>
<td width="30" class="tableContainerRow2">&#160;</td>
</tr>
</table>
<table class="tableContainer" cellspacing="10px">
<tr>
<td width="20%">Details</td>
<td class="tableContainerRow2">&#160;</td>
</tr>
</table>
<table class="tableContainer" cellspacing="10px">
<tr>
<td style="white-space:nowrap">Consultant Appt Made</td>
<td>YES</td>
<td>&#160;&#9745;</td>
<td>NO</td>
<td>&#160;&#9745;</td>
<td width="50%"></td>
</tr>
</table>
</div>
<div class="divContainerWhite">
<table class="tableContainerWhite" cellspacing="10px">
<tr>
<td style="text-decoration:underline;font-size:1.1em;font-weight:bold;">Baby</td>
<td>Routine Check:</td>
<td>&#160;&#9745;</td>
<td>Other Check</td>
<td>&#160;&#9745;</td>
<td>Day</td>
<td width="30" class="tableContainerRow2">&#160;</td>
<td>&#160;</td>
</tr>
<tr>
<td colspan="9">Details</td>
</tr>
<tr>
<td colspan="9" class="tableContainerRow2">&#160;</td>
</tr>
</table>
<table class="tableContainerWhite" cellspacing="10px">
<tr>
<td colspan="6" style="font-size:1.1em;font-weight:bold">PUK</td>
</tr>
<tr>
<td>Weight</td>
<td>&#160;&#9745;</td>
<td >SBR</td>
<td>&#160;&#9745;</td>
<td >&#160;</td>
<td>&#160;</td>
</tr>
<tr>
<td style="white-space:nowrap">Feeding Advice</td>
<td>&#160;&#9745;</td>
<td>Jaundice</td>
<td>&#160;&#9745;</td>
<td>&#160;&#9745;</td>
<td>TICK ON LEAVING LOCATION</td>
</tr>
</table>
</div>

<!--Footer-->
<div class="footer">
© 2009 Graphnet Health Ltd. All rights reserved. | Disclaimer
</div>

</body>

最佳答案

如果它适合单个页面并且您总是希望它在单个页面上,那么我会尝试指定 page-break-before: always。这有时会强制 2 页,而它可能适合一个页面,但它应该始终将表格保持在一个页面上,只要它适合。

关于html - 当打印多于一页时,它会在两页之间打断表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2086602/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com