Bonjour,
Je cherche à grouper (rowSpan) certaines cellules de ma table HTML:
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
 
    function function1() {
 
		for(var i1=0;i1<5;i1++){
		var target=document.getElementById('tab').rows[2];
		try{
		target.deleteCell(i1+1);}
		catch(err){alert(i1+'_'+err.message);}
		var target1=document.getElementById('tab').rows[1].cells;
		target1[i1+1].rowSpan="2";
		}
    }
</script>
<table border="1" id="tab" style="background-color:#f0f7f6">
					<colgroup>
						<col width="210"/>
						<col width="300"/>
						<col width="300"/>
						<col width="300"/>
						<col width="300"/>
						<col width="300"/>
					</colgroup>
					<tbody>
												<tr>
								<!-- if checkbox is checked, clone school subjects to the whole table row  -->
								<td ></td>
								<td  style="color:#444;background-color:#e0e0e0;text-align:center">lundi</td>
								<td  style="color:#444;background-color:#e0e0e0;text-align:center">mardi</td>
								<td  style="color:#444;background-color:#e0e0e0;text-align:center">mercredi</td>
								<td  style="color:#444;background-color:#e0e0e0;text-align:center">jeudi</td>
								<td  style="color:#444;background-color:#e0e0e0;text-align:center">vendredi</td>
 
							</tr>
						<tr>
							<td valign="top" id="td1" style="color:#444;background-color:#e0e0e0;height:15px;font-size:12px;font-weight:bold">8:00</td>
							<td valign="top" ></td>
							<td valign="top" ></td>
							<td valign="top" ></td>
							<td valign="top" ></td>
							<td valign="top" ></td>
						</tr>
						<tr>
							<td valign="top" id="td2" style="color:#444;background-color:#e0e0e0;height:15px;font-size:12px;font-weight:bold">9:00</td>
							<td valign="top" ></td>
							<td valign="top" ></td>
							<td valign="top" ></td>
							<td valign="top" ></td>
							<td valign="top" ></td>
						</tr>
						<tr>
							<td valign="top" id="td3" style="color:#444;background-color:#e0e0e0;height:15px;font-size:12px;font-weight:bold">9:30</td>
							<td valign="top" ></td>
							<td valign="top" ></td>
							<td valign="top" ></td>
							<td valign="top" ></td>
							<td valign="top" ></td>
						</tr>
						<tr>
						<td valign="top" id="td4" style="color:#444;background-color:#e0e0e0;height:15px;font-size:12px;font-weight:bold">11:00</td>
							<td valign="top" ></td>
							<td valign="top" ></td>
							<td valign="top" ></td>
							<td valign="top" ></td>
							<td valign="top" ></td>
						</tr>
					</tbody>
				</table>
<input type="button" value="Remove Cell 24" onclick="function1();">
Pour les 3 premières colonnes,pas de problème.
Pour les colonnes 3 et 4, j'ai le message suivant:
3(ou 4)_Index or size is negative or greater then the allowed amount.

Que se passe t'il?
D'avance merci.