Forum How do I...?

Hiding elements with jQuery

jprateragg
I'm using the following code to hide certain table columns. It works fine in the browser:
<script type="text/javascript">
$(document).ready(function() {
	$('.assets td:nth-child(3), .assets th:nth-child(3)').hide();
	$('.liabilities1 td:nth-child(6), .liabilities1 th:nth-child(6)').hide();
	$('.liabilities2 td:nth-child(8), .liabilities2 th:nth-child(8)').hide();
	$('.liabilities1a td:nth-child(3), .liabilities1a th:nth-child(3)').hide();
	$('.assets td:nth-child(2), .assets th:nth-child(2)').css("border-right", "1px grey dotted");
	$('#tl_blank_row').attr("colspan", "2");
});
</script>

However, it doesn't seem to work with Prince. I've seen some posts on here about jQuery support in Prince, but didn't know to what extent it was supported. I'm using jQuery 1.8 and PrinceXML 8.1r5 on Windows Server 2008 R2. Thanks!
mikeday
For Prince, it would be easier and more efficient to write this directly as CSS:
.assets td:nth-child(3), .assets th:nth-child(3) { display: none }
.liabilities1 td:nth-child(6), .liabilities1 th:nth-child(6) { display: none }
...

Actually, even in the browser this would be faster. :)
jprateragg
We did this with jQuery because we didn't want the columns to change size since they're variable width. But I think I'll just bite the bullet and make them a fixed width so I can use your solution. Thanks!