Click to See Complete Forum and Search --> : center aline problems


likwit
05-31-2006, 06:23 AM
Hi every 1,

I recently started to play around with visual web developer, and I have stubbled on a slight problem which am not able to go around it.

I searched the forum for related topics, checked several tutorials, books, etc... nothing doing.

Here is my problem:

I create a simple table and center it (no problem here), then place a button or an image and configuer the property panel to center the botton.

Now it looks fine untill i run the application, where in the IE the table stays centred but the botton drifts to the left and it seams that there is no way that i can budge it from the left.

If anyone could help me out to go round this bug of the VWD, I would be most greatful.

handshakeit
05-31-2006, 06:42 AM
You must show some code heree.....

likwit
05-31-2006, 08:56 AM
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<br />
<br />
<table align="center" border="1" bordercolor="#000000" cellpadding="0" cellspacing="0"
style="width: 740px">
<tr>
<td align="center" style="width: 100px">
<asp:Button ID="Button1" runat="server" Text="Button" /></td>
</tr>
</table>

</div>
</form>
</body>
</html>

handshakeit
06-01-2006, 04:21 AM
try this

<table align="center" border="1" bordercolor="#000000" cellpadding="0" cellspacing="0"
>
<tr>
<td align="center" style="width: 740px">
<asp:Button ID="Button1" runat="server" Text="Button" /></td>
</tr>
</table>

handshakeit
06-01-2006, 06:38 AM
what you were doing wrong is the width of table and cells are different
and you are placing button in the center of the cell
it was already in the center of the cell.....
which was only 100px
I think you got what was the error

likwit
06-01-2006, 07:50 AM
Thanks for the help, migrating from dreamweaver can be quite confusing...

I see now where the problem lied, yet again it still doesn´t real make sense to me.

Due to this part of the script " <td align="center" style="width: 100px">" what should have happed was that (taking from you reasoning) the button should have aligned in the center of the 100px and not all of the way to the left... if you know what i mean...

anyways... as long as it works am happy for now...lol

Thanks again for the help

handshakeit
06-01-2006, 08:02 AM
Due to this part of the script " <td align="center" style="width: 100px">" what should have happed was that (taking from you reasoning) the button should have aligned in the center of the 100px and not all of the way to the left... if you know what i mean...
Thats what I was trying to say.......