开发者

How to create a table with CSS [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Cl开发者_如何学Cosed 11 years ago.

I want to similar.

  1. How can I select first line?
  2. How can I create double system?

Shortly I want to create beautiful tables but how?

If you have nice tutorial please share with me..

EDIT: Sorry my first language is not English. Double system mean for example:

second line : blue 
third line : red 
fourth line : blue
...


To select the first row of a table, you can do this using jQuery:

$("table:first > tr:first")

To manipulate the css of that row you can use the .css() method:

var css = $("table:first > tr:first").css();

or

$("table:first > tr:first").css("color","red");

or

var cssObj = {
  'background-color' : 'Blue',
  'font-weight' : '',
  'color' : 'Black'
}

 $("table:first > tr:first").css(cssObj);

Using only CSS you can try using the :nth-child pseudo-class selector:

tr:nth-child(1) {
  brackground-color: Blue;
  color: Yellow;
}

tr:nth-child(2) {
  brackground-color: Yellow;
  color: Green;
}

tr:nth-child(3) {
  brackground-color: Red;
  color: White;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜