John500
asked on
How to center a button on web page ?
I have a web page (see picture below) which uses a submit button. I'm having problems centering this button in the middle of the page.
For the code which includes the 'Comments' & 'Submit' button see the snippet below.
How would this code have to change to center the button??
Thanks!
For the code which includes the 'Comments' & 'Submit' button see the snippet below.
How would this code have to change to center the button??
Thanks!
<table style="width: 100%" border="0" cellspacing="0" cellpadding="0" id="MainTable" runat="server">
<tr>
...
...
<tr>
<td colspan="1" style="height: 37px; width: 159px;"> Comments:</td>
<td colspan="2" style="height: 37px; width: 240px;">
<asp:TextBox id="TBComment" runat="server" Width="630px" Height="50px" TextMode="MultiLine"></asp:TextBox>
</td>
</tr>
<tr>
<td valign="top" style="height: 4px; width: 159px;"> </td>
</tr>
<tr>
<td colspan="3" align="center" valign="middle" style="height: 2px; width: 259px;">
<asp:Button ID="BSubmit" runat="server" Text="Submit" Width="103px" BorderStyle="Groove" OnClick="BSubmit_Click" TabIndex="26" /></td>
</tr>
</table>
UserModTable.JPG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try this code it works
the colspan int eh td in line no 12 was also missing & i have also removed the width inthe td on line 15 as suggested by both the above authors
the colspan int eh td in line no 12 was also missing & i have also removed the width inthe td on line 15 as suggested by both the above authors
<table id="MainTable" runat="server" border="1" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
</tr>
<tr>
<td colspan="1" style="height: 37px; width: 159px;">
Comments:
</td>
<td colspan="2" style="height: 37px; width: 240px;">
<asp:TextBox ID="TBComment" runat="server" Height="50px" TextMode="MultiLine" Width="630px"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="3" style="height: 4px; width: 159px;" valign="top">
</td>
</tr>
<tr>
<td align="center" colspan="3" style="height: 2px;" valign="middle">
<asp:Button ID="BSubmit" runat="server" BorderStyle="Groove" OnClick="Button_Click" TabIndex="26" Text="Submit" />
</td>
</tr>
</table>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, I was able to get something from each of your posts.
Open in new window