gpt4 book ai didi

css - 为什么表格不显示在 html 中?

转载 作者:太空宇宙 更新时间:2023-11-04 04:28:10 25 4
gpt4 key购买 nike

我写了一个html代码。在这里,我创建了一个表格,其中要显示一些行和一个表格。一切正常,但表格未显示在浏览器中。你能帮我么。提前致谢。

代码是:

<form>
<div id="formWrap">
<h1 align="center" style="color:#0000FF" >B.E. Degree Course Registration</h1>
<div id="form">

<div class="row">
<div class="label0" style="color:#FF0000; font-style:italic; margin-left:20px; font-size:18px">Personel details:</div>
</div> <!-- end of 0th row -->

<div class="row">
<div class="label">Name</div>
<div class="input">
<input type="text" id="fullname" required="required" class="detail" name="fullname" />
</div>
<div class="label">Sex</div>
<div class="inputradio">
<input type="radio" id="radio" required="required" class="detailradio" name="sex" />
<span class="style7">Male</span>
<input type="radio" id="sex" required="required" class="detailradio" name="sex" />
<span class="style7">Female </span></div>
</div> <!-- end of first row -->
<div class="label3">ECA</div>
<div class="inputeca">
<select name="eca">
<option id="eca" required="required" class="ecadetail" value="eca1">NSS</option>
<option id="eca" required="required" class="ecadetail" value="eca2">NCC</option>
<option id="eca" required="required" class="ecadetail" value="eca3">Cultural</option>
</select>
</div>
<div class="label3">Year</div>
<div class="inputyear">
<script language="JavaScript"> <!-- start JS code hide
// loop to create the list
var year = 2012
document.write("<select name='years'>");
for (var i=1; i <=200; i++)
{
year++;
document.write("<option>" + year + "</option>");
}
// end JS code hide -->
</script>
<p></p>
</div>
</div> <!-- end of row -->
<table width="600" border="2">
<tr>
<td>col1</td>
<td>col2</td>
<td>col3</td>
<td>col5</td>
<td>col6</td>
</tr>
</table>
<div class="row">
<div class="submit" style="margin-left:708px">
<input type="submit" id="submit" name="submit" value="Proceed"/>
</div>
</div>
</div>
</div>
</form>

最佳答案

改变:

<script language="JavaScript"> <!-- start JS code hide
// loop to create the list
var year = 2012
document.write("<select name='years'>");
for (var i=1; i <=200; i++)
{
year++;
document.write("<option>" + year + "</option>");
}
// end JS code hide -->
</script>

<select name="years">
<script language="JavaScript">
// loop to create the list
var year = 2012
for (var i=1; i <=200; i++)
{
year++;
document.write("<option>" + year + "</option>");
}
// end JS code hide -->
</script>
</select>

您不需要使用 JS 启动 select 标签,并且您忘记关闭标签,因此表格不会显示(可能还有其他内容)。

关于css - 为什么表格不显示在 html 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17844374/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com