Bonjour tout le monde,

J'ai un tableau qui contient 5 colonnes.

La 5e colonne contient des input.

J'aimerais simplement que la cellule active (celle qui a le focus) ait un fond jaune clair et un contour rouge.

Mieux encore, la ligne complète ne peut pas être de bordure rouge et l'input de la ligne en fond jaune claire ?

J'ai cherché sur les sujets déjà placés et j'ai trouvé ceci :

http://www.developpez.net/forums/m544417-6/

Mais après avoir fais un copier/coller du code dans Dreamweaver 8, le résultat me donne un tableau avec des inputs sans couleur.

Voici mon code au cas où :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Document sans nom</title>
</head>
 
<body>
<table border="1" width="100%">
	<tr >
		<td onfocus="this.parentNode.style.backgroundColor='red'" onblur="this.parentNode.style.backgroundColor='white'" width="20%"><input type="text" name="textfield" /></td>
		<td onfocus="this.parentNode.style.backgroundColor='red'" onblur="this.parentNode.style.backgroundColor='white'" width="30%"><input type="text" name="textfield2" /></td>
		<td  onfocus="this.parentNode.style.backgroundColor='red'" onblur="this.parentNode.style.backgroundColor='white'" width="25%"><input type="text" name="textfield3" /></td>
		<td onfocus="this.parentNode.style.backgroundColor='red'" onblur="this.parentNode.style.backgroundColor='white'" width="25%"><input type="text" name="textfield4" /></td>
	</tr>
	<tr>
		<td onfocus="this.parentNode.style.backgroundColor='red'" onblur="this.parentNode.style.backgroundColor='white'" width="20%">&nbsp;</td>
		<td onfocus="this.parentNode.style.backgroundColor='red'" onblur="this.parentNode.style.backgroundColor='white'" width="30%">&nbsp;</td>
		<td onfocus="this.parentNode.style.backgroundColor='red'" onblur="this.parentNode.style.backgroundColor='white'" width="25%">&nbsp;</td>
		<td onfocus="this.parentNode.style.backgroundColor='red'" onblur="this.parentNode.style.backgroundColor='white'" width="25%">&nbsp;</td>
	</tr></table>
</body>
</html>
Merci d'avance pour votre aide.

beegees