Questions about using tables to store data in web standards and changing the background color of cells

Source: Internet
Author: User

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");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.