Solved

How to align a button inside a table cell!

Posted on 2006-10-30
5
748 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to count occurrences of each item in an array.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

617 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