表格标签无法正常工作

时间:2015-05-30 12:43:03

标签: html tabs html-table

我正在尝试在我的html代码中使用表格,并给出tr选项卡,文本仍然是单行而不是多行。以下是我的代码:

<table>
<tr>
<b> Question 1. </b> Match List-I with List-II and select the correct answer    using  the code given below the lists :
</tr>
<br>
<table class="tab_ques">
<tr><td>List-I (Town) </td><td>List-II( River Nearer to it)</td></tr>
<tr><td>A. Betul</td><td>1. Indravati</td></tr>
<tr><td>B. Jagdalpur</td><td>2.Narmada</td></tr>
<tr><td>C. Jabalpur</td><td>3.Shipra</td></tr>
<tr><td>D. Ujjain</td><td>4.Tapti</td></tr>
</table>
<br>
<table class="tab_opt">
<tr><td>  </td><td>A</td><td>B</td><td>C</td><td>D</td></tr>
<tr><td> a. </td><td> 1 </td><td> 4 </td><td> 2 </td><td> 3 </td></tr>
<tr><td> b. </td><td> 4 </td><td> 1 </td><td> 2 </td><td> 3 </td></tr>
<tr><td> c. </td><td> 1 </td><td> 4 </td><td> 3 </td><td> 2 </td></tr>
<tr><td> d. </td><td> 4 </td><td> 1 </td><td> 3 </td><td> 2 </td></tr>
</table>
<br>
<tr>
<a href="ans_nobelprize_p1.html">Answer</a>
</tr>
<br>
<br>
<tr>
<td><b> Question 2. </b> Consider the following statement : </td>
</tr>
<tr>
<td>
1.The nation-wide scheme of the National Child Labour Projects (NCLP) is run    Union Ministry of Social Justice amd Empowerment.<br>
2.Gurupadswamy Committee dealt with the issue of child labour.
</td>
</tr>
<tr>
<td>
Which of the statements given above is/are correct?
</td>
</tr>
<tr>
<th> a. </th>
    <td> 1 only </td>
</tr>
<tr>
    <th> b. </th>
    <td> 2 only </td>
</tr>
<tr>
    <th> c. </th>
    <td> Both 1 and 2 </td>
</tr>
<tr>
    <th> d. </th>
    <td> Neither 1 nor 2</td>
</tr>
</table>
.tab_ques
td {
margin-left:150px; 
width:300px ; border: 1px solid none; 
}

.tab_opt
tr, td{
margin-left:50px; 
width:30px ; border: 1px solid none; 
}

这是我的完整代码。希望这能清楚地说明我出错的地方。

罚款至q1。但是当它到达问题2时,其格式化已全部消失。

2 个答案:

答案 0 :(得分:1)

<td>

之后添加<tr>

答案 1 :(得分:1)

您缺少第一行中的td标记。 br标签在那里什么都不做。

var myFactory = {
    "list" : "getData",
    "find" : 42
};
myFactory.list
//Outputs: "getData";
myFactory.find
//Outputs:42;