This example mainly aims to illustrate the problem of using tables to store data in web standards. If there is a large amount of data to be processed on the page, as long as your page uses Div + CSS layout, data can be stored in tables. The web standard does not allow the use of tables. By the way, the background color of a cell is changed. Here is a typical Div + CSS layout, where the data generated by PHP is stored in a table.
Tr. sfhover {color: #999999; Background: # f9f9f9;} tr {Background: # eeeeee;} table {border: solid 1px #336699 ;}
JSCodeIn
function suckerfish (type, Tag, parentid) {
If (window. attachevent) {
window. attachevent ("onLoad", function () {
var sfels = (parentid = NULL )? Document. getelementsbytagname (TAG): Document. getelementbyid (parentid ). getelementsbytagname (TAG);
type (sfels);
}< BR >}< br> sfhover = function (sfels) {
for (VAR I = 0; I sfels [I]. onmouseover = function () {
This. classname + = "sfhover";
}< br> sfels [I]. onmouseout = function () {
This. classname = This. classname. replace (New Regexp ("sfhover \ B"), "");
}< BR >}< br> suckerfish (sfhover, "TR");