Solved

How to align a button inside a table cell!

Posted on 2006-10-30
5
732 Views
Last Modified: 2008-02-07
This button will not align to the center of the td cell. It always stays at the to of the cell, which looks bad because the other cells end up below.

I've tried everyting I can think of to center the button inside the table but so far nothing works. If I have to use a style, I'd rather do so on the input line instead of css. But if not, then I'm open to ideas. This must be simple, but not for me.

<table border="1" align="center">
  <tr>
    <td align="center" valign="middle">
   <form name="form1" action="page1.cfm" method="post">
      <div align="center">
         <input type="submit" value="ShowPage1">
      </div>
   </form>
   </td>
   <td>
     Text in table td cell goes here.
   </td>
   <td>
     <img src="image.giv">
   </td>
  </tr>
</table>

 - Georgia
0
Comment
Question by:RollinNow
  • 2
  • 2
5 Comments
 
LVL 30

Accepted Solution

by:
Steggs earned 500 total points
ID: 17838599
Greetings RollinNow,

<table border="1" style="margin:0 auto;height:100px;">
  <tr>
    <td>
<form name="form1" action="page1.cfm" method="post" style="display:inline;">
<input type="submit" value="ShowPage1">
</form>
   </td>
   <td>
     Text in table td cell goes here.
   </td>
   <td>
     <img src="image.giv">
   </td>
  </tr>
</table>

Regards
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17838624
RollinNow,

What do you mean it isn't centered?  Do you mean vertically, horizontally or both?  Is that the same code you used because it appears to center vertically and horizontally in both IE and FF?  Please elaborate on the problem.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17838632
I did not see Stegg's comment so hopefully it fixes your problem.  Let us know if it doesn't.
0
 

Author Comment

by:RollinNow
ID: 17838641
You nailed it. Thanks for beautifying lots of websites and tons of pages.

I increased the points to 500.

  - Georgia
0
 
LVL 30

Expert Comment

by:Steggs
ID: 17838647
Your welcome, thanks for the A :)
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
remove background quote mark from widget 6 68
how to build a intranet site 8 42
Connection to multiple databases 13 26
xss alert in domino url 9 34
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to count occurrences of each item in an array.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question