Home >Web Front-end >HTML Tutorial >table css odd and even style_html/css_WEB-ITnose

table css odd and even style_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:09:371192browse

Pure CSS odd-even style
No JS scripts



100db36a723c770d327fc0aef2ce13b1
...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>

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

Statement:
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