Question:

javascript tables

by Guest1290613  |  2 years, 10 month(s) ago

0 LIKES UnLike

hey guys. 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: Javascript, Tables

   Report
SIMILAR QUESTIONS
CAN YOU ANSWER?
You're reading: javascript tables

Question Stats

Latest activity: 2 years, 10 month(s) ago.
This question has been viewed 200 times and has 0 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.