when i create a table with alternating rows the color of each row is changed.
but when i add a single row to this table the new row has the same color as the row above.
how can i change that?
when the last row is grey, the new row must be white, etc.
but when i add a single row to this table the new row has the same color as the row above.
how can i change that?
when the last row is grey, the new row must be white, etc.
Re: alternating table rows.
Re: alternating table rows.
Doesn't anyone have an idea?
Re: alternating table rows.
If you don't know anything about the editor it won't be easy at first, but it should be doable. Start reading the wiki, get a grasp of the source code and start doing little changes, then you'll understand where the changes need to be done.
Re: alternating table rows.
FCKTableHandler.InsertRow=function(){
var A=FCKSelection.MoveToAncestorNode("TR");
if (!A) return;
var B=A.cloneNode(true);
if(A.parentNode.rows.length%2 == 0){
//set the background color of B to 'cccccc'
}
A.parentNode.insertBefore(B,A);
FCKTableHandler.ClearRow(A);
}
How can i change the background color of a node?
It must be something like
A.style.backgroundColor = 'cccccc';
i guess but this doesn't work.
Re: alternating table rows.
A.className = "evenRow";
and if you want to specify directly the color, the use the proper notation: "#CCCCCC";
also, check that you aren't specifying a background color for the cells in your stylesheet.
Re: alternating table rows.
the color style i gave the TR element was overwritten by the style class from the TD elements.
all i need to do now is to set or remove the style class of the inserted rows.
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="alt"> </td>
<td class="alt"> </td>
how can i access the children of TD here?
this doesnt work:
var A=FCKSelection.MoveToAncestorNode("TR");
var B=A.cloneNode(true);
var C=B.getChildren();
C.removeAttribute('class');
I guess the getChildren Method is wrong.