Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relative Position not working at all 1

Status
Not open for further replies.

LittlBUGer

Programmer
Apr 26, 2006
81
US
Hello all. I have some code in my ASP.NET 2.0 webpage which doesn't seem to be working. Basically I have several controls with accompanying labels, all not visible by default. Each control/label is in their own asp.net table with a certain ID so that I can easily hide and unhide them. I have all of these inside a panel on my page. I then have a check box list that when the user checks a certain box, that specific control will then be visible, and so on and so forth for all boxes. What the problem is that if you start checking more than 1 box, each control (or essentially asp table) becomes visible below the previous one, so all controls are in a single "column" instead of flowing naturally across the page. I've tried setting the style position to relative but it doesn't seem to be doing anything. Any thoughts on this? Sample code is below:

Code:
   <asp:Panel Visible="false" ID="pnlAdminInput" runat="server" GroupingText="Input:">   
    <asp:Table style="position:relative" runat="server" ID="tableEID" GridLines="Both">
        <asp:TableRow runat="server">
            <asp:TableCell runat="server"><asp:Label ID="lblEID" runat="server" Text="EID:" /><br /><asp:DropDownList ID="ddEID" runat="server" DataSourceID="EIDData" DataTextField="EID" DataValueField="AnimalID" /></asp:TableCell>
        </asp:TableRow>
    </asp:Table>
    <asp:Table style="position:relative" runat="server" ID="tableBirthWeight" GridLines="Both">
        <asp:TableRow runat="server">            
            <asp:TableCell runat="server"><asp:Label ID="lblBirthWeight" runat="server" Text="Birth Weight (LBS):" /><br /><asp:TextBox ID="tbBirthWeight" runat="server" /></asp:TableCell>
        </asp:TableRow>
    </asp:Table>
...
...
...
</asp:Panel>

"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein
 
Tables are block level elements so their natural behaviour is to break and flow underneath the last element. You could try setting their display to inline, but a better method would be to float each table.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top