想要在打印时重复我的html页面的表头,或者以任何方式导出到Pdf

时间:2016-04-12 06:42:12

标签: javascript html css

想要在打印预览时以及通过任何方式导出到Pdf,在每个页面上重复我的html页面的表头。表中的数据不是静态的,它可能在每个td中动态变化。 我知道这里有类似的问题。但最后没有找到动态数据的答案。



	<table >
		<thead>
			<tr >
				<th>Month</th>
				<th>Year</th>
			</tr>
		</thead>
		<tbody>
		<tr>
				<td>February</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>March</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>April</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>May</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>June</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>July</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>August</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>September</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>October</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>November</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>February</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>March</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>April</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>May</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>June</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>July</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>August</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>September</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>October</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>November</td>
				<td>2015</td>
			</tr>
			
			<tr>
				<td>February</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>March</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>April</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>May</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>June</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>July</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>August</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>September</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>October</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>November</td>
				<td>2015</td>
			</tr>
			<tr >
				<td>December</td>
				<td>2015</td>
			</tr>
			<tr>
				<td>January</td>
				<td>2016</td>
			</tr>
			<tr>
				<td>February</td>
				<td>2016</td>
			</tr>
			<tr>
				<td>March</td>
				<td>2016</td>
			</tr>
			<tr>
				<td>April</td>
				<td>2016</td>
			</tr>
			<tr>
				<td>May</td>
				<td>2016</td>
			</tr>
			<tr>
				<td>June</td>
				<td>2016</td>
			</tr>
			<tr>
				<td>July</td>
				<td>2016</td>
			</tr>
			<tr>
				<td>August</td>
				<td>2016</td>
			</tr>
			<tr>
				<td>September</td>
				<td>2016</td>
			</tr>
			<tr>
				<td>October</td>
				<td>2016</td>
			</tr>
			<tr>
				<td>November</td>
				<td>2016</td>
			</tr>
			<tr >
				<td>December</td>
				<td>2016</td>
			</tr>
			<tr>
				<td>January</td>
				<td>2017</td>
			</tr>
			<tr>
				<td>February</td>
				<td>2017</td>
			</tr>
			<tr>
				<td>March</td>
				<td>2017</td>
			</tr>
			<tr>
				<td>April</td>
				<td>2017</td>
			</tr>
			<tr>
				<td>May</td>
				<td>2017</td>
			</tr>
			<tr>
				<td>June</td>
				<td>2017</td>
			</tr>
			<tr>
				<td>July</td>
				<td>2017</td>
			</tr>
			<tr>
				<td>August</td>
				<td>2017</td>
			</tr>
			<tr>
				<td>September</td>
				<td>2017</td>
			</tr>
			<tr>
				<td>October</td>
				<td>2017</td>
			</tr>
			<tr>
				<td>November</td>
				<td>2017</td>
			</tr>
			<tr >
				<td>December</td>
				<td>2017</td>
			</tr>
			<tr >
				<td>January</td>
				<td>2018</td>
			</tr>
			<tr>
				<td>February</td>
				<td>2018</td>
			</tr>
			<tr>
				<td>March</td>
				<td>2018</td>
			</tr>
			<tr>
				<td>April</td>
				<td>2018</td>
			</tr>
			<tr>
				<td>May</td>
				<td>2018</td>
			</tr>
			<tr>
				<td>June</td>
				<td>2018</td>
			</tr>
			<tr>
				<td>July</td>
				<td>2018</td>
			</tr>
			<tr>
				<td>August</td>
				<td>2018</td>
			</tr>
			<tr>
				<td>September</td>
				<td>2018</td>
			</tr>
			<tr>
				<td>October</td>
				<td>2018</td>
			</tr>
			<tr>
				<td>November</td>
				<td>2018</td>
			</tr>
			<tr >
				<td>December</td>
				<td>2018</td>
			</tr>
			
		</tbody>
	</table>
   
&#13;
&#13;
&#13;

0 个答案:

没有答案