tags:

views:

36

answers:

3

Here's the code:Well my problem's the grade column I want it to be two columns but I don't know how can anyone help me :(

<html>
<body>
<center>
<table border=2 width=50% cellspacing=5 cellpadding=8 bgcolor=yellow cols=2>
<tr>
<td rowspan=2>Name</td>
<td>ASP</td>

</tr>
<tr>
<td>Exer</td>
<td>Quiz</td>
<td>Recitation</td>
<td>Pe</td>
<td>Me</td>
<td>Grade</td>
</tr>

<tr>
<td>Student 1<td rowspan=5>&nbsp;</td><td colspan=4 rowspan=5>&nbsp;</td><td rowspan=5>&nbsp;</td></tr>
<tr>
<td>Student 2</td>
</tr>
<tr>
<td>Student 3</td>
</tr><tr>
<td>Student 4</td>
</tr>
<tr>
<td>Student 5</td>
</tr>
</table>
</body>
</html>
A: 

The td element has a colspan attribute that you can use to specify how many columns you want the td to occupy.

BrennaSoft
A: 

Refer to the "colspan and rowspan" section.

http://www.tizag.com/htmlT/tables.php

Webnet
+1  A: 

You mean you want the "Grade" header to span two columns beneath it? Add colspan="2" to the <td> element for that header and add new <td> elements to the row(s) beneath it.

<html>
<body>
<center>
<table border=2 width=50% cellspacing=5 cellpadding=8 bgcolor=yellow cols=2>
<tr>
<td rowspan=2>Name</td>
<td>ASP</td>

</tr>
<tr>
<td>Exer</td>
<td>Quiz</td>
<td>Recitation</td>
<td>Pe</td>
<td>Me</td>
<td colspan="2">Grade</td>
</tr>

<tr>
<td>Student 1<td rowspan=5>&nbsp;</td><td colspan=4 rowspan=5>&nbsp;</td><td rowspan=5>&nbsp;</td><td rowspan=5>&nbsp;</td></tr>
<tr>
<td>Student 2</td>
</tr>
<tr>
<td>Student 3</td>
</tr><tr>
<td>Student 4</td>
</tr>
<tr>
<td>Student 5</td>
</tr>
</table>
</body>
</html>
David
no I want to span the grade column upward
sayuki288
I'm not certain what you mean. Can you elaborate?
David