Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Colspan and alignment....

Reply
Thread Tools

Colspan and alignment....

 
 
jodleren
Guest
Posts: n/a
 
      02-19-2007
Hi!

I have a form, which has a comment after the text field, eventually a
button or something, then the text... the point, I was expecting to
align left when I set the last field to colspan=3.
The code below does not align as I want it too.. I think it is clear
when you see it... any ideas how I make this look good...
I have been looking into it, but need some help here....

Code are as follows

BR
Sonnich

<TABLE CELLPADDING="1" CELLSPACING="2" BORDER="1">
<TR>
<TD VALIGN=CENTER>Name:&nbsp;</TD>
<TD VALIGN=CENTER><INPUT TYPE=TEXT NAME="name" VALUE="Me!"
SIZE="25" MAXLENGTH="256" /></TD>
<TD COLSPAN="3" VALIGN=CENTER>comment</TD>
</TR>
<TR>
<TD VALIGN=CENTER>Name2:&nbsp;</TD>
<TD VALIGN=CENTER><INPUT TYPE=TEXT NAME="name" VALUE="Me!"
SIZE="25" MAXLENGTH="256" /></TD>
<TD VALIGN=CENTER>comment</TD>
<TD VALIGN=CENTER>&nbsp;</TD>
<TD VALIGN=CENTER>&nbsp;</TD>
</TR>
<TR>
<TD VALIGN=CENTER>Text:&nbsp;</TD>
<TD COLSPAN="4" VALIGN=CENTER><TEXTAREA NAME="text" COLS="60"
ROWS="7">bla bla bla bla bla bla bla bla </TEXTAREA></TD>
</TR>
<TR>
<TD VALIGN=CENTER><INPUT TYPE=SUBMIT NAME="btn_go_save"
VALUE="Submit" ONCLICK="setvar(this.name);" /></TD>
<TD COLSPAN="3" VALIGN=CENTER><INPUT TYPE=SUBMIT
NAME="btn_delete" VALUE="Delete" ONCLICK="setvar(this.name);" /></TD>
<TD VALIGN=CENTER><P ALIGN=RIGHT><A HREF="../people.php?
name=inga&amp;lng=ee">Test here</A></TD>
</TR>
</TABLE>

 
Reply With Quote
 
 
 
 
Bergamot
Guest
Posts: n/a
 
      02-19-2007
jodleren wrote:
>
> The code below does not align as I want it too.. I think it is clear
> when you see it...


If you want people to see it, you should post a URL, not code.

--
Berg
 
Reply With Quote
 
 
 
 
jodleren
Guest
Posts: n/a
 
      02-19-2007
On Feb 19, 10:43 pm, Bergamot <(E-Mail Removed)> wrote:
> jodleren wrote:
>
> > The code below does not align as I want it too.. I think it is clear
> > when you see it...

>
> If you want people to see it, you should post a URL, not code.


Here it is
http://my.tele2.ee/sonnich/test.htm
(though no functionality)

BR
Sonnich

 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      02-19-2007
Scripsit jodleren:

> I have a form, which has a comment after the text field, eventually a
> button or something, then the text... the point, I was expecting to
> align left when I set the last field to colspan=3.
> The code below does not align as I want it too.. I think it is clear
> when you see it...


It isn't. Even after you posted the URL, you haven't said _what_ was it that
you expected to align left and how (on which browser) it isn't aligned left.
You have no align="left" attribute, though that's the default, and all the
fields look very much left aligned to me on IE 7, except the very last cell
where you have ALIGN=RIGHT in your code (and a semantically wrong P
element - there's no paragraph there).

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
Bergamot
Guest
Posts: n/a
 
      02-20-2007
jodleren wrote:
> On Feb 19, 10:43 pm, Bergamot <(E-Mail Removed)> wrote:
>> jodleren wrote:
>>
>> > The code below does not align as I want it too.. I think it is clear
>> > when you see it...

>>
>> If you want people to see it, you should post a URL, not code.

>
> http://my.tele2.ee/sonnich/test.htm


I'm with Jukka. It is not clear what your issue is, but it seems likely
you are trying to fix the wrong problem.

You have decided on a solution (colspans) when you haven't properly
identified what you are trying to accomplish. The best way to achieve
your goal may be a different method altogether.

--
Berg
 
Reply With Quote
 
Chaddy2222
Guest
Posts: n/a
 
      02-20-2007


"jodleren" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Hi!
>
> I have a form, which has a comment after the text field, eventually a
> button or something, then the text... the point, I was expecting to
> align left when I set the last field to colspan=3.
> The code below does not align as I want it too.. I think it is clear
> when you see it... any ideas how I make this look good...
> I have been looking into it, but need some help here....
>
> Code are as follows
>

<snip>
Frankly, you should not use tables at all for this, it's a simple form,
place each field in a Div and give it some style with CSS where necessary.
--

Regards Chad.
http://freewebdesign.cjb.cc


 
Reply With Quote
 
Sonnich
Guest
Posts: n/a
 
      02-20-2007
On Feb 20, 1:03 am, "Jukka K. Korpela" <(E-Mail Removed)> wrote:
> Scripsit jodleren:
>
> > I have a form, which has a comment after the text field, eventually a
> > button or something, then the text... the point, I was expecting to
> > align left when I set the last field to colspan=3.
> > The code below does not align as I want it too.. I think it is clear
> > when you see it...

>
> It isn't. Even after you posted the URL, you haven't said _what_ was it that
> you expected to align left and how (on which browser) it isn't aligned left.
> You have no align="left" attribute, though that's the default, and all the
> fields look very much left aligned to me on IE 7, except the very last cell
> where you have ALIGN=RIGHT in your code (and a semantically wrong P
> element - there's no paragraph there).
>
> --
> Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/


I simply want the "comment" to be next to the input field.
I think it is funny, that in the lower row, the colspan works, and the
test here is really one, while the delete is colspan=3 and relly is so
(som 60% I'd guess).
The first row - I was expecting the text followed by an input field
and the last ~60% for the last <td colspan=3>, forcing the text next
to the input field.
On 2nd row, I would have expected it somewhat evenly 20% for each
<td>. Now it is more like: 10-50-25-5-15. The input is much wider,
that is my main issue.

/S

 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      02-20-2007
Scripsit Sonnich:

> I simply want the "comment" to be next to the input field.


So apparently the problem is not alignment: the "comment" is left aligned
within its cell, and you don't even need to do anything with it (it's the
default). The problem is in _cell widths_: the cell containing the input
field is wider than needed for the field,

> I think it is funny, that in the lower row, the colspan works,


Of course it works on the first two rows as well. It's the division of the
table's width (dominated by the textarea width) to columns that causes the
phenomenon. There is no simple fix, since browsers allocate column widths
weirdly, but the overall complexity of the table affects this. So why do you
use colspan in the first place? If you want some text to appear (almost)
immediately after an input field, why don't you put them into the same cell?
I guess I can guess some of the reasons, but the sketchy page really
suggests that the table is excessively complicated.

> The first row - I was expecting the text followed by an input field
> and the last ~60% for the last <td colspan=3>, forcing the text next
> to the input field.


Nobody expects... the IE column allocation!

That could be a tough problem, since IE resists attempts to control its
allocation algorithm except by explicitly setting "absolute" widths for
everything, which is a manifestly Bad Idea.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
Sonnich
Guest
Posts: n/a
 
      02-20-2007
On Feb 20, 11:06 am, "Jukka K. Korpela" <(E-Mail Removed)> wrote:
> ScripsitSonnich:
>
> > I simply want the "comment" to be next to the input field.

>
> So apparently the problem is not alignment: the "comment" is left aligned
> within its cell, and you don't even need to do anything with it (it's the
> default). The problem is in _cell widths_: the cell containing the input
> field is wider than needed for the field,
>
> > I think it is funny, that in the lower row, the colspan works,

>
> Of course it works on the first two rows as well. It's the division of the
> table's width (dominated by the textarea width) to columns that causes the
> phenomenon. There is no simple fix, since browsers allocate column widths
> weirdly, but the overall complexity of the table affects this. So why do you
> use colspan in the first place? If you want some text to appear (almost)
> immediately after an input field, why don't you put them into the same cell?
> I guess I can guess some of the reasons, but the sketchy page really
> suggests that the table is excessively complicated.


I have one check box, I simply want the comments in a nice coloumn to
the right, and still have the textbox.
For that I need the table. Also inputs etc might have different
widths.
I wonder whether a table in a table might be the solution.

/S

 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      02-20-2007
Scripsit Sonnich:

> I have one check box,


No, not on the page that you specified.

> I simply want the comments in a nice coloumn to
> the right, and still have the textbox.


For clarity and accessibility, you should have only one input field and its
label on one line (with few exceptions), so the goal should be reconsidered.

> For that I need the table.


Well, using a table is tricky in a case like this. Before digging deeper,
consider whether you need to be in a hole. I don't mean the table as such;
simple tables are simpler, and a form could be construed as containing
tabular data. But the more complexity you add, the more browsers will bite
you. Their table behavior has always been poor.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
getting to grips with colspan and images Peter HTML 8 09-02-2009 10:46 AM
Table with Alternating Color Columns and Colspan cho.cabot HTML 3 11-13-2006 02:53 PM
DataGrid and colspan Question needin4mation@gmail.com ASP .Net 1 10-10-2005 08:24 PM
Colspan and rowspan Klaus Wertler HTML 8 11-27-2003 10:02 PM
colspan and rowspan problems Bruce W...1 HTML 2 10-22-2003 10:06 PM



Advertisments