0
<tr>
        <td colspan="2" align="center">
		<input type="button" class="btn" value="New" name="New" onClick="window.location.href='new2.php'" onMouseOver="hov(this,'btn btnhov')" onMouseOut="hov(this,'btn')" align="absmiddle">
          
&nbsp; <input type="submit" value="Delete" name="delete" class="btn" onMouseOver="hov(this,'btn btnhov')" onMouseOut="hov(this,'btn')" ></td>
        </tr>

I am unable to make thses two buttons centred .... any help??

TIA

4
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by nonshatter
0

You do not say center to what? Your code starts with <tr> so I presume you want to place the two buttons center to a table?

If so, use this:

<CENTER>
<TABLE>

<tr>
        <td colspan="2" align="center">
		<input type="button" class="btn" value="New" name="New" 

onClick="window.location.href='new2.php'" onMouseOver="hov(this,'btn 

btnhov')" onMouseOut="hov(this,'btn')" align="absmiddle">
          
&nbsp; <input type="submit" value="Delete" name="delete" class="btn" 

align="center" onMouseOver="hov(this,'btn btnhov')" 

onMouseOut="hov(this,'btn')" ></td>
        </tr>

</TABLE>
</CENTER>
0

Using <center> is deprecated since HTML 4.0. You should use CSS to control the styles:

<style type="text/css">
    td.tdcenter
    {
         text-align:center;
         padding: 2px;
    }
</style>

<tr>
        <td class="td_center">
		<input type="button" class="btn" value="New" name="New" onClick="window.location.href='new2.php'" onMouseOver="hov(this,'btn btnhov')" onMouseOut="hov(this,'btn')" align="absmiddle">
 
&nbsp; <input type="submit" value="Delete" name="delete" class="btn" onMouseOver="hov(this,'btn btnhov')" onMouseOut="hov(this,'btn')" ></td>
</tr>

Edited by nonshatter: n/a

0

Sorry I was incorrect. text-align won't work because it only applies to in-line content, not a block-level element like a table.

<html>
<head>
</head>
<body>
        <table style="margin:0 auto;">
        <tr>sdkjfs'asfjd'pjdfsa'kjfsdl;kajsf;lkjasd;lfkja</tr>
        <tr>
                <td style="margin:0 auto;">
                        <input type="button" class="btn" value="New" name="New" onClick="window.location.href='new2.php'" onMouseOver="hov(this,'btn btnhov')" onMouseOut="hov(this,'btn')" align="absmiddle">&nbsp;
                        <input type="submit" value="Delete" name="delete" class="btn" onMouseOver="hov(this,'btn btnhov')" onMouseOut="hov(this,'btn')" >
                </td>
        </tr>
        </table>
</body>
</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.