Link to home
Start Free TrialLog in
Avatar of vbnetcoder
vbnetcoder

asked on

contents of a html cell

I have a html table cell with 2 controls. Currently, the controls are stacked one on top of the other BUT I want them to be side by side. How do i do this
<td class="style20">
                                        <asp:label ID="txtDisplayProductOnline" runat="server" Text=""></asp:label>                                
                                                    <asp:RadioButtonList ID="rdDisplayOnline" runat="server" Height="18px" 
                                                        RepeatDirection="Horizontal" Width="115px">
                                                        <asp:ListItem Selected="True">Yes</asp:ListItem>
                                                        <asp:ListItem>No</asp:ListItem>
                                                    </asp:RadioButtonList>
                                    </td>

Open in new window

Avatar of rawinnlnx9
rawinnlnx9
Flag of United States of America image

<table>
<tr>
<td>Control one goes here.</td><td>Control 2 goes here.</td>
</tr>
</table>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of jasonduan
jasonduan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<tr> = table row
<td> = columns in the table.

Something worth understanding is how <spans> work so that you can have some rows with 5 columns and some rows with 1 column or 2.
Avatar of vbnetcoder
vbnetcoder

ASKER

rawinnlnx9: I forgot to mention that these controls are not going to be visible at the same time.  I want them in exactly the same place if possible.

jasonduan: I tried you solution and it did not make a difference
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
dtocci: they are stacked in design  view but not neither show on the screen when the program is run..
Hmm.  Nothing in that code should make them disappear.  When you view the html source of the resulting page is anything outputting inside the <span> tags?

When you said "these controls are not going to be visible at the same time", do you mean they won't be rendered in the html code at the same time or they'll both be there but only one will be made visible at a time with CSS?  If it's the former, you don't even need the span tags because only one will appear at a time.  If it's the latter, then maybe something you've done in the CSS is making them invisible?
In my asp.net code I show them or hide them based on if it is in edit mode or view mode. They will not both be visible at the same time ever....
Actually, I noticed they ARE showing but not in the cell but instead in the top right of my screen
Then it sounds like you can just leave the code the way you had it when you posted the question. They may be stacked in design view but when the page is rendered only one should appear.  It would be impossible for them to be stacked or side-by-side if you only have one or the other rendering.  That should work unless I'm missing something.
I want them to appear in the same spot ... currently, the label control appears in on spot when  visible and the radio button control below it...

I will keep working on this.... I am rebuilding the form now it is all messed up
Just noticed your comment about how they are showing but not in the cell.  That means the <td> container is missing the  style="position:relative".  It needs that so that the position:absolute on the spans will work relative to it, instead of relative to the whole page.

Also, if you use that solution, you may want to set a width for the td cell as it will probably no longer stretch to accommodate what is inside it.  

I'm still not sure why the radio control would appear out of place if it is the only thing being rendered in the cell (without the span wrappers).
ty