|
Posted by TheBagbournes on 01/28/07 18:37
Jukka K. Korpela wrote:
> Scripsit TheBagbournes:
>
>> I figured it out :
>
> I don't think so. You didn't react the question whether you should
> really use a table, and this normally means you shouldn't.
>
> Moreover, you seem to have rejected my simple and correct markup in
> favor of more complex and less correct.
>
>> <table cellspacing="0" cellpadding="0">
>> <tr>
>> <td rowspan="2">
>> Single Row
>> </td>
>> <td>
>> Top half
>> <td>
>> </tr>
>> <tr>
>> <td colspan="2">
>> Bottom half
>> </td>
>> <tr>
>> </table>
>>
>> You have to give the td on the second row colspan="2",
>
> Wrong.
>
>> otherwise the
>> table is not balanced (every row has to have the same number of
>> columns spanned).
>
> Wrong. _Your_ table is not balanced, since the first row has two columns
> and the second row has three columns: one cell shared with the upper row
> and two columns spanned by the second cell.
>
> Did you look at the effect? Add border="1" to the <table> tag and you'll
> see that your table is not balanced: "Top half" is a bit narrower than
> the "Bottom half", because there is ghost column, so to say.
>
> An unbalanced table is not explicitly forbidden in HTML specifications,
> but the effects are unpredictable.
>
Well, I needed to use a table to constrain the two right hand elements to line up exactly to the right of the left hand element, and each be exactly half the height, exactly adjacent.
I was creating a spinner control. It's the only way to do it. A self contained element that contains one input field, and two CSS-styled divs which act as buttons.
Adding
td { border:1px solid black} shows you are correct in that there is an extra bit on the right at the bottom. But that first example you gave didn't work at all.
I'm really not concerned with fashionable dogma about tables being "evil" or over in javascript land eval being "evil". I don't use tables for page layout because it's over-complicated. But I do use use whatever works without torturing myself or my code to fit fads.
Navigation:
[Reply to this message]
|