Jquery_review color and keyword highlighting in the form

Source: Internet
Author: User

in many projects, of course, you can avoid using table, and use Div instead, but in order to be able to quickly deliver projects, but also for network optimization and search engines do not have a high compromise, we can of course use the popular table for layout. Using a tabular layout is ideal for many of the project teams are new members, and the technology is not yet mature enough to be able to determine what the DIV's layout will bring. The following is a jquery implementation that uses table to make interlaced colors in tables and highlight keywords.

Here are a few things to note is that table CSS settings, thead and tbody are not good settings border properties, so can only compromise the use of TD Border-top or Border-bottom properties to increase the upper and lower partition of the table. How to achieve an interlaced color of the table, here is a jquery provided by the selector,: Odd is to select the number of elements. : Even is the selection of the first number of elements, the order in which the child elements are selected in jquery starts with 1, but the rest is basically starting from 0, and this place needs to be noticed. Also, how do I highlight a row that contains a keyword? You can use jquery's content selector. : Contains (' KeyWord ') This allows you to get some of the keywords in the current element. Here is an example of this demo:

<%@ page language= "java" import= "java.util.*" pageencoding= "Utf-8"%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >


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.