Forum Moderators: open
Ive tweaked it a little so it is on by default, and to switch it off, i give the table a class of 'noruler'.
This is fine when thats the only class on that table, but some tables have stuff like:
class="noruler col1 col2"
I need to modify the following line to account for the multiple classes:
if(tables[i].className!=='noruler')
So what do i add to match 'noruler' followed by zero or more other class names?
Thanks
if(/\bnoruler\b/.test(tables[i].className))
a generic function:
function hasClass(elm, className)
{
return (new RegExp("\\b"+className+"\\b")).test(elm.className);
}
followed by zero or more other class names?
Note that both the above will return true if the className exists (as a single word) anywhere in the whole class attribute string. It is possible to modify it to make sure that the className is the very first in the string, but I doubt that really matters to you.