Forum Moderators: open

Message Too Old, No Replies

table: setting rowspan & colspan

         

qwert

8:21 am on Apr 14, 2006 (gmt 0)

10+ Year Member



Hello;
why i use the "<TD colspan=4 rowspan=4>", it does not work? thanks

<TABLE BORDER width=100%>
<TR>
<TH COLSPAN=2>Head1</TH>
<TH COLSPAN=2>Head2</TH>
</TR>

<TR>
<TD colspan=4 rowspan=4>A</TD>
</TR>

</TABLE>

Robert2

9:17 am on Apr 14, 2006 (gmt 0)

10+ Year Member



I'm not exactly sure what you would like to achieve and what you feel does not work.
Perhaps that you expected the second row to be bigger, because you specified rowspan=4.
However there are no 4 rows available to span too.
Maybe you'll understand it better when you see this example:


<TABLE BORDER width=100%>
<TR>
<TH COLSPAN=2>Head1</TH>
<TH COLSPAN=2>Head2</TH>
<TH COLSPAN=2>Head3</TH>
</TR>
<TR>
<TD colspan=4 rowspan=4>A</TD>
<TD colspan=2>B</TD>
</TR>
<TR>
<TD colspan=2>B</TD>
</TR>
<TR>
<TD colspan=2>B</TD>
</TR>
<TR>
<TD colspan=2>B</TD>
</TR>
</TABLE>

qwert

10:13 am on Apr 14, 2006 (gmt 0)

10+ Year Member



Thanks for your reply.

Yes, I'd like to make the second row to be bigger, and the second row span to right and bottom, but i could not span the rows.

but now i can span the rows now with the following
"<TD colspan=4 rowspan=4 height=100>A</TD> "

Robert2

10:32 am on Apr 14, 2006 (gmt 0)

10+ Year Member




but now i can span the rows now with the following
"<TD colspan=4 rowspan=4 height=100>A</TD> "

Uhmm no you can't. Yes the height made your cell bigger, but that has nothing to do with spanning. Just remove the rowspan=4 and you will get the same result.

Also in your case you can remove the colspan=2 on the TH elements, and replace the colspan="4" with colspan="2".

qwert

10:59 am on Apr 14, 2006 (gmt 0)

10+ Year Member



yes, that'true, it has nothing to do with spanning. Thanks anyway

rocknbil

9:24 pm on Apr 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



He's telling you things go wonky when you try to span columns that don't exist. Although colspan=2 + colspan=2 = colspan=4, there aren't 4 columns. Same is true of rowspan.