Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 529
  • Last Modified:

asp:Table renders differently in VS2008 than IIS 6.0

I have a couple of asp:tables (one is attached, the other is very similar). This centers the tables in the Visual Studio development server but not in IIS 6.0 in my demo/staging server. In VS2008, the tables are centered; in IIS 6.0 it seems to ignore the Left specification in the style attribute.

Thanks!

Gary
<table cellspacing="5px" width="60%" border="2px" style="left:20%; position:relative">
            <tr>
                <td align="right"><asp:Label ID="nameLabel" runat="server" Text="Logged In User:"  /></td>
                <td align="left"><asp:TextBox ID="nameTB" runat="server" ReadOnly="true" CssClass="userName" /></td>
            </tr>
        </table>

Open in new window

0
gmsteele44
Asked:
gmsteele44
  • 4
  • 3
  • 2
2 Solutions
 
gdupadhyayCommented:
Try this


           
<table cellspacing="5px" width="60%" border="2px"  style="left:20%; position:relative; z-index: auto;">
            <tr>
                <td align="right"><asp:Label ID="nameLabel" runat="server" Text="Logged In User:"  /></td>
                <td align="left"><asp:TextBox ID="nameTB" runat="server" ReadOnly="true" CssClass="userName" /></td>
            </tr>
        </table>

Open in new window

0
 
Kamal KhaleefaInformation Security SpecialistCommented:
try to change left:20%
to padding-left:50px;

then change the value of the 50 px based on ur requirement
0
 
gdupadhyayCommented:
Its working in both case. are you using any parent control (like table to div)?
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
gmsteele44Author Commented:
The table is inside a div with style horizontal-align:Center. Neither of the above solutions is working in IIS. They do work in VS development server, as does my original code. I'm wondering if there is a setting in IIS 6.0 that affects this? Or a .NET service pack? I believe my server is fully up to date but I may have missed something.
0
 
gmsteele44Author Commented:
Here is a shot of the bad rendering (IIS 6.0) (bad.png) and the good one (Visual Studio 2008 Dev server) (good.png).
 Rendered from IIS 6.0 on Win2003 Rendered from VS2008 on Win7
0
 
Kamal KhaleefaInformation Security SpecialistCommented:
try to make border=1 for your table
and then start to edit the values of padding , align ..etc
once u put border =1 it can help u determine what to do
and why the table is missed
0
 
gdupadhyayCommented:
It is not related to IIS or any service pack. Its basic HTML error.
Can you post the more design code (Atleast upper portion of page) ?
0
 
gmsteele44Author Commented:
It turned out to be compatibility mode. It was turned on for intranet sites. When I turned it off, rendering was normal.

Thanks for all the suggestions!
0
 
gmsteele44Author Commented:
Everyone was very helpful with plenty of good suggestions.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now