How to create a table with CSS [closed]
I want to similar.
- How can I select first line?
- 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;
}
精彩评论