Konrad Viltersten wrote:
As it isnow i have to use a syntax for my tables as:
<table class = "some" border>
and/or
<table class = "some" noborder>
Of course if anybody knows how to do it with CSS
that would be even more great.
You can use JavaScript to change the CSS class of the table, or to
change its border attribute value, or its style object. To be silly
about it you could also change a style rule that applies to the
table, but that may be going too far.
OK, that's good. The thing is that even if i can controll the
event that is suppose to make the change i'm still rather
ignorant about what the name of the property is. To be sure
we're talking about the same thing - i'm not refering to a
border *around* the object (i.e. table) but the borders
*inside* a table. How do we get to them?
I think now you are into CSS more than JavaScript, but let's keep going.
The borders 'inside' the table belong the rows and cells, so use
something that sets them to what you want then modify them.
Below is a simple example . Production will require far more thought and
rigour - help with that can be provided once your requirements are known
in more detail:
<head>
<style type="text/css">
table { border: 1px dotted red;}
.cellA {border: 1px solid blue;}
.cellB {border: 1px solid red;}
</style>
<script type="text/javascript">
function toggleClass( el ){
if ( el.className ){
el.className = ('cellA' == el.className)? 'cellB':'cellA' ;
}
}
</script>
</head>
<body>
<table>
<tr>
<th>Here is a head cell</td>
<th>And another head cell</td>
</tr>
<tr>
<td class="cellA" onclick="
toggleClass(thi s)
">Here is a cell</td>
<td class="cellA" onclick="
toggleClass(thi s)
">And another cell</td>
</tr>
</table>
</body>
--
Rob