我正在本页面中间打印一个javascript日历,由于某种原因,当我运行此代码时,地址块将打印在日历打印的表格上方。我需要在地址栏上方打印日历。在此先感谢您的任何帮助
<body>
<div id="head">
<img style="float: right; border: 1px solid orange" src="photo.jpg" alt="" />
<img src="ccc.jpg" alt="Chamberlain Civic Center" />
</div>
<div id="links">
<table><tr>
<td><a href="#">Home</a></td><td><a href="#">Tickets</a></td>
<td><a href="#">Events</a></td><td><a href="#">Directions</a></td>
<td><a href="#">Hours</a></td><td><a href="#">Calendar</a></td>
<td><a href="#">Tour</a></td><td><a href="#">Contact Us</a></td>
</tr></table>
</div>
<div id="main">
<h1>Yearly Calendar</h1>
<table id='yearly_table'>
<tr>
<th id='yearly_title' colspan='4'></th>
</tr>
<script type="text/javascript">
yearly();
</script>
</div>
<address>
The Chamberlain Civic Center ·
2011 Canyon Drive ·
Chamberlain, SD 57325 ·
(800) 555-8741
</address>
</body>
答案 0 :(得分:1)
看起来您没有关闭表格标记,将其放在</script>
行下面:</table>
答案 1 :(得分:0)
只需在div标签中添加地址即可。像这样。
<html>
<head>
</head>
<body>
<div id="head">
<img style="float: right; border: 1px solid orange" src="photo.jpg" alt="" />
<img src="ccc.jpg" alt="Chamberlain Civic Center" />
</div>
<div id="links">
<table>
<tr>
<td><a href="#">Home</a></td><td><a href="#">Tickets</a></td>
<td><a href="#">Events</a></td><td><a href="#">Directions</a></td>
<td><a href="#">Hours</a></td><td><a href="#">Calendar</a></td>
<td><a href="#">Tour</a></td><td><a href="#">Contact Us</a></td>
</tr>
</table>
</div>
<div id="main">
<h1>Yearly Calendar</h1>
<table id='yearly_table'><tr>
<th id='yearly_title' colspan='4'>
</th>
</tr>
<script type="text/javascript">
yearly();
</script>
</div>
<div>
<address>
The Chamberlain Civic Center ·
2011 Canyon Drive ·
Chamberlain, SD 57325 ·
(800) 555-8741
</address>
</div>
</body>
</html>