Question:

javascript help

by Guest9184  |  12 years, 9 month(s) ago

0 LIKES UnLike

hello. i have created a javascript file that stripes rows of my table that i made in html. now i need to edit this javascript so that my columns are now striped and not my rows. wondering if someone could help me out. here is the javascript for striping the rows of my table.

var StripyTables =
{
init: function()
{
var tables = Core.getElementsByClass("dataTable");

for (var i = 0; i < tables.length; i++)
{
var tbodys = tables[i].getElementsByTagName("tbody");

for (var j = 0; j < tbodys.length; j++)
{
var rows = tbodys[j].getElementsByTagName("tr");

for (var k = 1; k < rows.length; k += 2)
{
Core.addClass(rows[k], "alt");
}
}
}
}
};

Core.start(StripyTables);

 Tags: Help, Javascript

   Report

1 ANSWERS

  1. Guest6960
    var rows = tbodys[j].getElementsByTagName("td");

    will this not work???

Sign In or Sign Up now to answser this question!
You're reading: javascript help

Question Stats

Latest activity: 12 years, 9 month(s) ago.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.