Workaround for FF printing fieldset truncated to one page (bug 471015)
When printing a document, Firefox truncate <fieldset>
to one page. This mean that a form with a <fieldset>
that would take more than one page in print can not be printed correctly. This is apparently a known bug tracked on bugzilla since 2008 (seebug 471015).
Is there a workaround (CSS or other) that allow printing of a single <fieldset开发者_如何学JAVA>
on several pages ? (other than not using <fieldset>
) ?
Check out this jQuery hack I just wrote to solve this issue, figured I'd share even though I'm a year late. You can change "printEnclosure" to an HTML tag I believe and the CSS at the end is obviously optional.
<div id="printEnclosure">
<fieldset>
<legend>TEST</legend>
Test Content goes here...
</fieldset>
</div>
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready(function()
{
$('#printEnclosure').find('fieldset').each(function(i)
{
$(this).replaceWith('<div id="convertedfieldset'+i+'">'+$(this).html()+'</div>');
$('div#convertedfieldset'+i).css('display','inline').css('text-align','left');
});
});
/* ]]> */
</script>
精彩评论