0
<table align="center" cellpadding="0" cellspacing="0" border="0" height="32px">
    <tr>
        <td>
            <img src="http://img203.imageshack.us/img203/8052/lefto.png" border="0" />
        </td>
        <td style="background:url(http://img24.imageshack.us/img24/2825/centervw.png); background-repeat: repeat-x; color:#FFFFFF;">
            Press Me Press Me Press Me Press Me Press Me Press Me Press Me Press Me Press Me
        </td>
        <td>
            <img src="http://img23.imageshack.us/img23/4676/rightk.png" />
        </td>
    </tr>
</table>

I have nice button that auto re-sizes based on length of text in middle table column try it here http://jsfiddle.net/QaFTc/2/

What i need is to do same without using tables and centered.

I tried and i either get not centered or i have to specify the width of button.

John Smith
  • 631
  • 3
  • 12
  • 30

2 Answers2

0

This is what i got: http://jsfiddle.net/nqGX8/

No tables, divs only. You can use images instead of the colors.

circusdei
  • 1,907
  • 12
  • 27
0

I Added a button using button and span modified jsfiddle

Anoop
  • 22,031
  • 9
  • 59
  • 70
  • Now how do you center it as my link its in the center. – John Smith Oct 09 '12 at 20:03
  • I modified my jsfiddle http://jsfiddle.net/QaFTc/7/. I am using text-align center on button parent(moved button inside a div). – Anoop Oct 09 '12 at 20:08
  • Problems with button tag: "a potentially dangerous Request.Form value was detected", because IE6 submits the html inside of the button, which, in my case, has html tags in it." from http://stackoverflow.com/questions/1903453/what-disadvantages-are-there-to-the-button-tag-it-seems-there-are-quite-a-fe – circusdei Oct 09 '12 at 20:19