Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Nov 2014
    Posts
    11
    Member #
    40705
    Liked
    1 times

    Making a button with <table>

    Hi!

    I would like to make a button out of a table so it can get indexet.
    And i also wanna override the css for links, so its a static look.
    I found two alternatives and wonder which is best coded?
    (I would like the table/button to autofit to the text)



    This one look alright, but only the text is clickable here.
    HTML Code:
    <table style="width: 250px;" border="0" cellspacing="0" cellpadding="0">
    <tbody>
    <tr>
    <td class="padding2" style="padding: 25px 0 0 0;" colspan="2" align="left">
    <table class="responsive-table" border="0" cellspacing="0" cellpadding="0">
    <tbody>
    <tr>
    <td style="padding: 12px 18px 12px 18px; -webkit-border-radius: 25px; border-radius: 25px;" align="center" bgcolor="#3a992f"><a style="font-size: 12px; font-family: Helvetica, Arial, sans-serif; font-weight: normal; color: #ffffff; text-decoration: none;" href="url" target="_blank">Book time</a></td>
    </tr>
    </tbody>
    </table>
    </td>
    </tr>
    </tbody>
    </table>

    I like this one because the whole table is clickable and not only the text.
    But the text isnt centered, its like 2/3 down.

    HTML Code:
    <table cellspacing="0" cellpadding="0">
    <tbody>
    <tr>
    <td style="-webkit-border-radius: 25px; -moz-border-radius: 25px; border-radius: 25px; color: #ffffff; display: block;" align="center" bgcolor="#3a992f" width="300" height="40"><a style="font-size: 16px; font-weight: bold; font-family: Helvetica, Arial, sans-serif; text-decoration: none; line-height: 40px; width: 100%; display: inline-block;" href="url"><span style="color: #ffffff;">Book time</span></a></td>
    </tr>
    </tbody>
    </table>

  2.  

  3. #2
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    They both suck, really, but if you adjust the line-height on the second one, you should be able to bump the text up to where you want it.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  4. #3
    Junior Member
    Join Date
    Nov 2014
    Posts
    11
    Member #
    40705
    Liked
    1 times
    Ok, why do they suck?
    What needs to be done to make a good one?


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:51 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com