If you are able to change your mark-up, the easiest, and most cross-browser compliant way of acheiving this is to use a 'test' class, for example:
.test {background-color:#FC0;} <table id="students" class="test">...</table> <table id="marks" class="test">...</table> <table id="classes" class="test">...</table>
If you're not able to change the mark-up but you are able to use jQuery you can style IDs that end with 'test' like so:
$(document).ready(function(){ $('table[id$=test]').css('background-color','#FC0'); });
Your final option, if you can't or won't use jQuery (or similar) is to use pure CSS3. This uses the same syntax as above but will only work in the more modern browsers:
table[id$=test] {background-color:#FC0;}