科尔斯潘问题-格式丢失

时间:2018-11-21 11:55:54

标签: html

每当我在下面的代码中将最后一个问题的最后一个colspan设置为匹配先前的colspans(至7)时,html表都会将所有先前的colspans重置为1。这是html代码:

<head>

<style>
table, th, td {
    /* border: 1px solid black;*/
}
</style>

</head>

<html>
	<body>
	<form action="myphproutine.php" method="post">
	<table align="left" cellspacing="50" cellpadding="5">
		<tr>
            <th id="question" colspan="7">Questions</th>
            <th id="option1">Option 1</th>
            <th id="option2">Option 2</th>
            <th id="option3">Option 3</th>
            <th id="option4">Option 4</th>
        </tr>
		<tr>
			<th align="left" bgcolor="grey" colspan="7">I found out that this is question 1</th>
			<td headers="option1" align="center">1
			    <input type="radio" name="D1" value="1"/></td>
			<td headers="option2" align="center">2
				<input type="radio" name="D1" value="2"/></td>
			<td headers="option3" align="center">3
				<input type="radio" name="D1" value="3"/></td>
			<td headers="option4" align="center">4
				<input type="radio" name="D1" value="4"/></td>
		</tr>
		<tr>
			<th align="left" bgcolor="grey" colspan="7">I was aware that this is question 2</th>
			<td align="center">1
				<input type="radio" name="D2" value="1"/></td>		
			<td align="center">2
				<input type="radio" name="D2" value="2"/></td>		
			<td align="center">3
				<input type="radio" name="D2" value="3"/></td>
			<td align="center">4
				<input type="radio" name="D2" value="4"/></td>
		</tr>
		<tr>
			<th align="left" bgcolor="grey" colspan="7">I couldn't seem to understand question 3</th>
			<td align="center">1
				<input type="radio" name="D3" value="1"/></td>
			<td align="center">2
				<input type="radio" name="D3" value="2"/></td>
			<td align="center">3
				<input type="radio" name="D3" value="3"/></td>
			<td align="center">4
				<input type="radio" name="D3" value="4"/></td>
		</tr>
		<tr>
			<th align="left" bgcolor="grey" colspan="2">I experienced breathing difficulties when using colspan </th>
			<td align="center">1
				<input type="radio" name="D4" value="1"/></td>
			<td align="center">2
				<input type="radio" name="D4" value="2"/></td>
			<td align="center">3
				<input type="radio" name="D4" value="3"/></td>
			<td align="center">4
				<input type="radio" name="D4" value="4"/></td>
		</tr>
		</table>
		<p>
		<br><center/>
			<input type="hidden" name="submitted" value="TRUE" />
			<input type="submit" name="submit" value="submit" />
	</form> 	
		</p>
	</body>
	</html>

嗨,每当我将以下代码中看到的最后一个问题的最后一个colspan设置为匹配先前的colspans(至7)时,html表都会将所有先前的colspans重置为1。 有人可以帮我理解为什么会发生这种情况。

0 个答案:

没有答案