table css odd and even style_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:09:37
Original
1157 people have browsed it

Pure CSS odd-even style
No JS scripts




...ignore


Reply to discussion (solution)

Is it possible with CSS3?

Write class
or
in interval tr. Note on typing td th (does not meet the standard)

<!DOCTYPE HTML><html>	<head>		<meta charset="gb2312" />		<title></title>			<style>			td {				background:#eee;			}			th {				font-weight:normal;				background:#ddd;			}		</style>			</head>	<body>		<table>			<tr>				<td>1-1</td>				<td>1-1</td>				<td>1-1</td>			</tr>			<tr>				<th>1-1</th>				<th>1-1</th>				<th>1-1</th>			</tr>			<tr>				<td>1-1</td>				<td>1-1</td>				<td>1-1</td>			</tr>		</table>	</body></html>
Copy after login

https://developer.mozilla.org/en /CSS/:nth-child
IE9

http://www.cnblogs.com/xihulangzi/articles/939591.html

Define 2 class styles
Odd lines Use different ones for even-numbered rows.

This complicates the problem again. . . .

Turns out it can’t be done. I’ll just use js script to do it. Thank you everyone

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template