| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using Rowspan, can spanned rows have unequal heights
I have a simple table as follows:
Code:
<table width=120> <tr> <td width=100 rowspan=2>Short text</td> <td width=10>Small</td> </tr> <tr> <td>Large</td> </tr> <tr> <td rowspan=2>Long text which is long enough to span more the first row <td>Small</td> </tr> <tr> <td>Large</td> </tr> I want the cell height for "Small" in the Long text row to be about the same height as the cell height for "Small" in the Short text row and have the cell height for "Large" in the Long text row to expand as much as necessary. I tried experimenting with row height but that didn't make a difference. Any suggestions? Thanks in advance. |
|
#2
|
||||
|
||||
|
Not sure what your question is, but your layout is slightly off:
Code:
Using this, my rowspans are not the same size. |
|
#3
|
||||
|
||||
|
Please keep attributes within quotes. If at all possible, you'll want to convert to a CSS layout rather than a table layout as it is standard.
|
|
#4
|
||||
|
||||
|
You know, I'm not 100% sure because I only scanned the code, but I think you want to use "colspan" rather than "rowspan" in this instance.
|
|
#5
|
|||
|
|||
|
mehere: I actually did want Small and Large to alternate but on review I did notice that the long text cell was missing the closing tag. I revised the layout as follows to be clearer:
Code:
<table width=150 border=1> <tr> <td width=75 rowspan=2>Short text</td> <td width=75>Short 1a</td> </tr> <tr> <td>Short 1b</td> </tr> <tr> <td rowspan=2>Long text which is long enough to span more the first row</td> <td>Long 1a</td> </tr> <tr> <td>Long 1b</td> </tr> </table> In IE 6, it comes out as the following (ASCII version):
-------------------------
| |Short 1a |
|Short Text |-----------
| |Short 1b |
-------------------------
-------------------------
|Long Text | |
|which is |Long 1a |
|long | |
|enough to |----------|
|span | |
-------------------------|more the |Long 1b |
|first row | |
What I want to achieve is the following:
-------------------------
| |Short 1a |
|Short Text |-----------
| |Short 1b |
-------------------------
-------------------------
|Long Text |Long 1a |
|which is |----------|
|long |Long 1b |
|enough to | |
|span | |
-------------------------|more the | |
|first row | |
Any thoughts? |
|
#6
|
||||
|
||||
|
In IE the remaining columns/cells that are not spanned will always be equal size compared to the column/cells that are spanned.
ie: rowspan 3 cells, the alternate cells will all be equal in size at 33% of the rowspan cell. However, if you insert a height="2px" attribute on the <td> tag it will do what you want, but not in IE. It will, however, do it in Firefox. Don't know if there's a fix for IE, unless maybe if you use CSS. |
|
#7
|
|||
|
|||
|
Thanks mehere.
|
![]() |
| Viewing: ASP Free Forums > Web Design > Web Layout > Using Rowspan, spanned rows have equal heights |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|