I'd like to get some basic help with an html thing that simply defeats me, every time

Discussion in 'HTML & Website Design' started by ChiWhiz, Aug 6, 2011.

  1. #1
    I'm not a programmer, and I don't know much html, but I have made efforts to learn a bit here and there.

    In every case, simply CENTERING something defeats me. I can usually center text, and center text within a table, but centering a form within a table row -- can't do it, can't find HOW to do it, etc. There's got to be something I can do. I've tried so many things, spent hours trying so many things.

    I'd provide a link, but live links not available to me yet -- I just want to k now what to do to my autoresponder opt-in form to center it. I'd spell out the link but don't want to risk violating the link rule -- or can I do that? Or, can I post the autoresponder code?

    I imagine I could get help from the autorespnder support people, but I'd like to get this out before Monday, which is the earliest they're available.

    Can anyone help? I'd be SO grateful.

    And to be clear: Yes, I'm looking for the immediate help with this form, but I'd really like to learn what is the secret trick for this so I can DO it on my own, next time and every time. If you've got a link to a tutorial, or some other resource, or can spell it out, or --- ?? (If you have a mic I have access to a webinar-like conference room where someone could look at the code on my computer desktop and perhaps tell me or DECONSTRUCT it for me.)
     
    ChiWhiz, Aug 6, 2011 IP
  2. Toycel

    Toycel Peon

    Messages:
    243
    Likes Received:
    11
    Best Answers:
    4
    Trophy Points:
    0
    #2
    how are you centering things?

    the best way is to use CSS to center anything, that's using divs. if you need help pm me and I'll see if I can find a solution for you. 
     
    Toycel, Aug 6, 2011 IP
  3. Andre91

    Andre91 Peon

    Messages:
    197
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    0
    #3
    Tables? What's tables? Always heard my grandparents mentioning tables but never looked into it. 
    Any way, To center anything in css in quite simple. I'll be glad to help. Just Post here or PM me.
    If you wanna center a form itself which I doubt is what you meant, it'll be like this using CSS: 
     
    <html>
      <head>
        <style>
          #main{
               width: 100%;
          } 
         #centered_form{
                position: relative;
                margin: 0px auto 0px auto;
         } 
        </style> 
      </head>

      <body>
        <div id="main">
            <form action="xxx" method="xxx" id="centered_form">
            </form>
        </div>
      </body>
    </html> 
     
    Andre91, Aug 6, 2011 IP
  4. xira

    xira Active Member

    Messages:
    315
    Likes Received:
    8
    Best Answers:
    4
    Trophy Points:
    68
    #4
    Your best bet is CSS, but I am assuming you are unfamiliar with it. So therefore sticking to HTML as much as possible (and using your table), you need to create a defined area/division of content. By doing this, you can then center that within your table.
    <table width="500">
    <tr>
    <td align="center"><div>First Name <input name="firstname" type="text" /></div></td>
    </tr>
    <tr>
    <td align="center"><div>Last Name <input name="lastname" type="text" /></div></td>
    </tr>
    </table>

    Today most people only use tables for showing tabular data. CSS is a powerful tool that enables exact placement and styles for website content. If you become interested in controlling you really should look into it. You can start here at the W3C.
    Good luck.
     
    xira, Aug 6, 2011 IP
  5. linc

    linc Member

    Messages:
    355
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    28
    #5
    If you would like to centring the entire form, you should deal with css like Andre91 showed above.
     
    linc, Aug 9, 2011 IP
  6. creativewebmaster

    creativewebmaster Active Member

    Messages:
    654
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    78
    #6
    I agree with Andre91.
     
    creativewebmaster, Aug 9, 2011 IP
  7. ChiWhiz

    ChiWhiz Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Of course I meant center the form itself, and said so -- clearly, I thought -- in my third sentence.
     
    ChiWhiz, Aug 9, 2011 IP
  8. hkhera

    hkhera Peon

    Messages:
    118
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I can provide you solution for each prob. and will teach u as well.

    u got Skype?

    mine is harpreet.khera

    Thanks
     
    hkhera, Aug 10, 2011 IP
  9. ChiWhiz

    ChiWhiz Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thank you. I've sent you a PM.
     
    ChiWhiz, Aug 10, 2011 IP
  10. lysoleverywhere

    lysoleverywhere Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    CSS
    .centeredBOX {margin: 0 auto;width: 200px;}

    HTML
    <div class="centeredBOX">CENTER ME AND MAKE ME 200 PIXELS WIDE</div>




    done.
     
    lysoleverywhere, Aug 11, 2011 IP
  11. ChiWhiz

    ChiWhiz Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    You know what? I got all excited about this, and sure enough -- what you posted works. BUT it falls apart for me as soon as I tried to add centering and width. I don't know how to do that properly.
     
    ChiWhiz, Aug 13, 2011 IP
  12. lysoleverywhere

    lysoleverywhere Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    link me to your page and I'll fix it.
     
    lysoleverywhere, Aug 14, 2011 IP