1

我正在此页面中间打印一个 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 &nbsp;&#183;&nbsp;
   2011 Canyon Drive &nbsp;&#183;&nbsp;
   Chamberlain, SD 57325 &nbsp;&#183;&nbsp;
   (800) 555-8741
   </address>

</body>
4

2 回答 2

1

看起来你没有关闭表格标签,把它放在下面的</script>行:</table>

于 2012-09-12T08:54:45.653 回答
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 &nbsp;&#183;&nbsp;
  2011 Canyon Drive &nbsp;&#183;&nbsp;
  Chamberlain, SD 57325 &nbsp;&#183;&nbsp;
  (800) 555-8741
  </address>
  </div>

</body>
</html>
于 2012-09-12T08:50:08.280 回答