align center not working in IE

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

I have the following:

<tr valign="baseline">
<td align="center" width="103" colspan=2 nowrap>
<asp:Button ID="ViewPositions" runat="server" Text="View Positions"
OnClick="ViewPositions_Click" />
<asp:LinkButton text="Advanced" onClick="Advanced_Click"
runat="server"/>
</td>
</tr>

In Mozilla, it works as I expected the button in the center with the
linkbutton next to it.

In IE, it puts the Button to the right with the LinkButton below it?????

Why is this?

Tom
 
Tom:
Not sure I fully understand what the problem is and what you want to get,
but try remove the space between the elements:

<asp:Button ID="ViewPositions" runat="server" Text="View Positions"
OnClick="ViewPositions_Click" /><asp:LinkButton text="Advanced"
onClick="Advanced_Click" runat="server"/>

might not show up well in the newsgroup..but just don't put the asp:button
and the asp:linkbutton on separate pages...actually glue them together (or
use a &nbsp;) if you want a space between them.

Karl


--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 
Karl Seguin said:
Tom:
Not sure I fully understand what the problem is and what you want to get,
but try remove the space between the elements:

<asp:Button ID="ViewPositions" runat="server" Text="View Positions"
OnClick="ViewPositions_Click" /><asp:LinkButton text="Advanced"
onClick="Advanced_Click" runat="server"/>

might not show up well in the newsgroup..but just don't put the asp:button
and the asp:linkbutton on separate pages...actually glue them together (or
use a &nbsp;) if you want a space between them.

That doesn't seem to help.

Here is the viewsource from the page after it is rendered:

<tr valign="baseline">
<td align="center" width="103" colspan=2 nowrap>
<input type="submit" name="ViewPositions" value="View Positions"
id="ViewPositions" /><a
href="javascript:__doPostBack('_ctl0','')">Advanced</a>
</td>
</tr>

It shows that the cell should be aligned center and the linkbutton should be
next to the submit button (which it is in Mozilla) - but not in IE.

Tom
 
That's funny...it works for me in IE and not in Firefox :)

to get it working in firefox, I had to add:

style="white-space:nowrap;" in the TD else it would wrap to the next
line....

Might you be having a style having some effect on it? or perhaps another
table cell is the problem? What happens when you totally simplify it?

<table>
<tr valign="baseline">
<td align="center" width="103" nowrap="nowrap">
<input type="submit" name="ViewPositions" value="View Positions"
id="ViewPositions" /><a
href="javascript:__doPostBack('_ctl0','')">Advanced</a>
</td>
</tr>
</table>


Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 
Back
Top