Table not lining up next to text

T

tshad

How do I get a table to line up next to my text in the same cell (I know a
table in a table is not a good thing - this is how MS does it with their
asp:radiobuttonlist objects)

I am trying to get the radio buttons next to my text and not below it.

I have a sample that shows the problem -
http://www.payrollworkshop.com/samples/tableAlign.htm.

The code is:

******************************************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<table width="309" height="117" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="180" height="76" style="vertical-align:top" nowrap>this is a
test
<table width="99" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="53">&nbsp;</td>
<td width="46">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>
*************************************************************

I just want to get the table up next to the text "this is a test".

Thanks,

Tom
 
R

Roy Schestowitz

tshad said:
How do I get a table to line up next to my text in the same cell (I know a
table in a table is not a good thing - this is how MS does it with their
asp:radiobuttonlist objects)

I am trying to get the radio buttons next to my text and not below it.

I have a sample that shows the problem -
http://www.payrollworkshop.com/samples/tableAlign.htm.

The code is:

******************************************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<table width="309" height="117" border="1" cellpadding="0"
cellspacing="0">
<tr>
<td width="180" height="76" style="vertical-align:top" nowrap>this is
a
test
<table width="99" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="53">&nbsp;</td>
<td width="46">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>
*************************************************************

I just want to get the table up next to the text "this is a test".

Thanks,

Tom

Use a 3-column table within. A table cannot be placed in-line with other
elements. For example, you cannot have 2 tables rooted in the same line as
a linebreak will be forced. More ideally, kill tables and start using divs.

Roy
 
J

Jukka K. Korpela

tshad said:
How do I get a table to line up next to my text in the same cell

Meaning what? I have a vague idea of what "line up next to" might mean,
but I'm afraid that even people with some variant of English as their
native language might interpret the statement in different ways.
(I know a table in a table is not a good thing

It rarely is. It activates bugs, and usually at least one of the tables
is not really tabular data.
- this is how MS does
it with their asp:radiobuttonlist objects)

But why would you be limited by that in HTML?
I am trying to get the radio buttons next to my text and not below
it.

That one I can understand, but how does that relate to what you said
first (or in the Subject line)?

Are we supposed to guess that the dummy text is in fact a legend for a
set of radio buttons and the dummy cells is the table are actually
radio buttons?

Why didn't you include a _real_ sample? Surely there's something
between revealing the actual data in your payroll and presenting
pointlessly dummy stuff.
The code is: - -
<title>Untitled Document</title>

According to Google, myriads of pages have actually been published with
such a title, by the way. If an authoring tool creates such nonsense,
the first thing in creating a new page should be to change the title
text. Even for test pages, since otherwise you learn wrong habits.
<table width="309" height="117"

Stop using pixel dimensions. Actually, don't set any dimension unless
you know why and how to do it properly.
I just want to get the table up next to the text "this is a test".

I could tell you, but then I would have to tell you why you are doing
things wrong now.

For a set of radio buttons, first think whether that's really the best
approach for setting up a selection interface (see
http://www.cs.tut.fi/~jkorpela/forms/choices.html )
and if you _know_ it is, use <fieldset>, with the explanation in
<legend>, and with each alternative on a line of its own,
naturally with <label> to indicate the associations.

After doing that, post the URL and ask about tuning the visual
appearance, if you think that's a problem you cannot solve
on your own.
 
R

Roy Schestowitz

Jukka said:
Meaning what? I have a vague idea of what "line up next to" might mean,
but I'm afraid that even people with some variant of English as their
native language might interpret the statement in different ways.


It rarely is. It activates bugs, and usually at least one of the tables
is not really tabular data.


But why would you be limited by that in HTML?


That one I can understand, but how does that relate to what you said
first (or in the Subject line)?

Are we supposed to guess that the dummy text is in fact a legend for a
set of radio buttons and the dummy cells is the table are actually
radio buttons?


Why didn't you include a _real_ sample? Surely there's something
between revealing the actual data in your payroll and presenting
pointlessly dummy stuff.


According to Google, myriads of pages have actually been published with
such a title, by the way. If an authoring tool creates such nonsense,
the first thing in creating a new page should be to change the title
text. Even for test pages, since otherwise you learn wrong habits.


Stop using pixel dimensions. Actually, don't set any dimension unless
you know why and how to do it properly.


I could tell you, but then I would have to tell you why you are doing
things wrong now.

For a set of radio buttons, first think whether that's really the best
approach for setting up a selection interface (see
http://www.cs.tut.fi/~jkorpela/forms/choices.html )
and if you _know_ it is, use <fieldset>, with the explanation in
<legend>, and with each alternative on a line of its own,
naturally with <label> to indicate the associations.

After doing that, post the URL and ask about tuning the visual
appearance, if you think that's a problem you cannot solve
on your own.

Jukka,

You are the toughest person in alt.html without a doubt. *smile* You know
your stuff, but be gentle with people whose expertise level differs from
yours. It is not CSS-D of which I noticed you're a subscriber as well. Help
them, don't scare them. *smile*
 
T

Travis Newbury

Jukka said:
According to Google, myriads of pages have actually been published with
such a title, by the way. If an authoring tool creates such nonsense,
the first thing in creating a new page should be to change the title
text. Even for test pages, since otherwise you learn wrong habits.

You know, this is an excellent (and very often missed) point!
 
T

Travis Newbury

Roy said:
Jukka,
You are the toughest person in alt.html without a doubt. *smile* You know
your stuff, but be gentle with people whose expertise level differs from
yours. It is not CSS-D of which I noticed you're a subscriber as well. Help
them, don't scare them. *smile*

Man, I thought it was a very tame (and informative) response.
 
R

Roy Schestowitz

Travis said:
Man, I thought it was a very tame (and informative) response.

It was. Jukka's replies are strong, right to the point, and interesting. I
was **smiling** to emphasise that it was not criticism.

Roy
 
S

Sid Ismail

On Sat, 02 Apr 2005 00:24:17 GMT, "tshad"

: <body>
: <table width="309" height="117" border="1" cellpadding="0" cellspacing="0">
: <tr>
: <td width="180" height="76" style="vertical-align:top" nowrap>this is a
: test

</td>
<td>

: <table width="99" border="1" cellspacing="0" cellpadding="0">
: <tr>


Sid
 
T

tshad

Sid Ismail said:
On Sat, 02 Apr 2005 00:24:17 GMT, "tshad"

: <body>
: <table width="309" height="117" border="1" cellpadding="0" cellspacing="0">
: <tr>
: <td width="180" height="76" style="vertical-align:top" nowrap>this is a
: test

</td>
<td>

: <table width="99" border="1" cellspacing="0" cellpadding="0">
: <tr>

You're right.

This would probably work, but I was trying to get out of creating another
table (or cell).

This is what others have been telling me is a bad thing to do.

Tom
 
T

tshad

Jukka K. Korpela said:
Meaning what? I have a vague idea of what "line up next to" might mean,
but I'm afraid that even people with some variant of English as their
native language might interpret the statement in different ways.


It rarely is. It activates bugs, and usually at least one of the tables
is not really tabular data.


But why would you be limited by that in HTML?

Because that is what MS is doing with its asp.net objects.

My code has a some text with 2 radio buttons (asp:radiobuttonlist) next to
(not below) the text. The object is rendered as a table. Why MS does this
I don't know. They could just as easily put 2 radio buttons next to each
other without a table, but they don't.
That one I can understand, but how does that relate to what you said
first (or in the Subject line)?

The radio buttons are rendered as a table.

Here is the actual code I am trying to make work:

Receive: <asp:RadioButtonList ID="EmailNewJobsFrequency"
RepeatDirection="Horizontal" style="display:inline-table;" runat="server">
<asp:ListItem Selected="true" Text="Daily" />
<asp:ListItem Text="Weekly" />
</asp:RadioButtonList>

Here is what it is rendered into from asp.net:

Receive:<table id="EmailNewJobsFrequency" border="0"
style="display:inline-table;">
<tr>
<td><input id="EmailNewJobsFrequency_0" type="radio"
name="EmailNewJobsFrequency" value="Daily" checked="checked" /><label
for="EmailNewJobsFrequency_0">Daily</label></td><td><input
id="EmailNewJobsFrequency_1" type="radio" name="EmailNewJobsFrequency"
value="Weekly" /><label for="EmailNewJobsFrequency_1">Weekly</label>
</td>
</tr>
</table>

The radio buttons are all horizontally next to each other, but below the
text "Recieve:".
Are we supposed to guess that the dummy text is in fact a legend for a
set of radio buttons and the dummy cells is the table are actually
radio buttons?

No.

I was trying to demonstrate the problem with a simple example. The problem
is not the radio buttons (they would display next to the text fine). The
problem is the table next to the text (since the radio buttons are rendered
to a table). If I told you they were buttons, I would not be explaining the
problem correctly (as they aren't the problem).
Why didn't you include a _real_ sample? Surely there's something
between revealing the actual data in your payroll and presenting
pointlessly dummy stuff.

I can't.

It is asp.net code not html code. I need to show you the problem in html.
If I can make the html work, I can normally make the asp.net code work. For
example, if the "style='display:inline-table' had worked in html, it
probably would have worked in asp.net. If you look at my above example, I
did add it into the asp.net control and it rendered correctly.

But if the html won't work, the asp.net won't work either.
According to Google, myriads of pages have actually been published with
such a title, by the way. If an authoring tool creates such nonsense,
the first thing in creating a new page should be to change the title
text. Even for test pages, since otherwise you learn wrong habits.


Stop using pixel dimensions. Actually, don't set any dimension unless
you know why and how to do it properly.

I didn't.

Everyone keeps complaining about this. I didn't do this. DW did. Front
Page is worse about this. If you take the width and heights out, it puts
them back when you make changes.
I could tell you, but then I would have to tell you why you are doing
things wrong now.

For a set of radio buttons, first think whether that's really the best
approach for setting up a selection interface (see
http://www.cs.tut.fi/~jkorpela/forms/choices.html )
and if you _know_ it is, use <fieldset>, with the explanation in
<legend>, and with each alternative on a line of its own,
naturally with <label> to indicate the associations.

The selection interface is fine, but the problem is that I am not setting up
html radio buttons, but asp radio button lists which are rendered as a
table.
After doing that, post the URL and ask about tuning the visual
appearance, if you think that's a problem you cannot solve
on your own.

I did.

This IS the problem I can't solve.

Tom
 
T

Toby Inkster

tshad said:
That doesn't seem to work.

"display:inline-table" and its friend "display:inline-block" have limited
browser support at the moment. They are (of course) both supported by
Opera and have been for quite some time. IIRC, Mozilla and its brethren
support one of them, but not the other. I can't remember which.
 
A

Adrienne

You know, this is an excellent (and very often missed) point!

I have my editor set up as
<title><!-- Change Title --></title>

So, when I am viewing the page in a browser, if I forgot, I notice it
right away.

I also have comments red on yellow so they stand out. Hrmph, I still
forget sometimes, hence, that text.
 
S

Spartanicus

Toby Inkster said:
"display:inline-table" and its friend "display:inline-block" have limited
browser support at the moment. They are (of course) both supported by
Opera and have been for quite some time. IIRC, Mozilla and its brethren
support one of them, but not the other. I can't remember which.

Unless something has changed in recent nightly builds, Gecko supports
neither value.
 
T

tshad

Toby Inkster said:
"display:inline-table" and its friend "display:inline-block" have limited
browser support at the moment. They are (of course) both supported by
Opera and have been for quite some time. IIRC, Mozilla and its brethren
support one of them, but not the other. I can't remember which.
Actually, both work in Opera and neither seem to work for Mozilla, firefox,
Netscape or IE.

The following has display:inline-block.

http://www.payrollworkshop.com/samples/tableAlign3.htm

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top