How to create two text boxes side by side

Discussion in 'PHP' started by chrisj, Aug 12, 2007.

  1. #1
    On this page, in the middle of the text, I'd like to add two text boxes side by side, separated by a vertical line.

    Can someone tell me how to do that? Thanks

    <body>
    <table width="770" border="0" cellpadding="0" cellspacing="0" id="maintable">
      <tr>
        <td colspan="2" id="topline">&nbsp; </td>
      </tr>
    Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text
    
      <tr>
        <td id="footer" colspan="2"></td>
      </tr>
    </table>
    </body>
    Code (markup):
     
    chrisj, Aug 12, 2007 IP
  2. daman371

    daman371 Peon

    Messages:
    121
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This is what I came up with.

    
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <style type="text/css">
    #middle {
    border-left: 1px solid #000000;
    border-right: 1px solid #000000;
    padding: 2px;
    }
    </style>
    </head>
    <body>
    <table width="770" border="0" cellpadding="0" cellspacing="0" id="maintable">
      <tr>
        <td colspan="2" id="topline">&nbsp; </td>
      </tr>
    <div id="middle">Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text Text, text, text
    </div>
      <tr>
        <td id="footer" colspan="2"></td>
      </tr>
    </table>
    </body>
    </html>
    Code (markup):
     
    daman371, Aug 12, 2007 IP
  3. web_dev

    web_dev Peon

    Messages:
    230
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I don't undertstand what you mean by in the middle of the text.

    But if you want 2 text boxes side-by-side sperated by a vertical line you can do this

    
    <table>
     <tr>
        <td><input type="text" name="text1"></td>
        <td> | </td>
        <td><input type="text" name="text2"></td>
     </tr>
    </table>
    
    HTML:
     
    web_dev, Aug 12, 2007 IP
  4. chrisj

    chrisj Well-Known Member

    Messages:
    606
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #4
    Thanks for your reply.

    In this example, where would I place the text?

    thanks again.

    <table> <tr>    <td><input type="text" name="text1"></td>    <td> | </td>    <td><input type="text" name="text2"></td> </tr></table>
    Code (markup):
     
    chrisj, Aug 12, 2007 IP
  5. coderlinks

    coderlinks Peon

    Messages:
    282
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #5
    By text, I suppose you mean the value in the box? Well that you should specify as the 'value' of the input tag. Like so:
    
    <input type="text" name="text1" value="My text blah blah">
    
    Code (markup):
    ~
    Thoma
     
    coderlinks, Aug 12, 2007 IP
  6. chrisj

    chrisj Well-Known Member

    Messages:
    606
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #6
    I probably have asked for this all wrong.

    I put text in the boxes like so "<font face="Arial" color="#EE7600" size="3"><b>exercising</b> <br></font><font face="Arial" color="#6B6B6B" size="2">is great for you

    And it just doesn't look right.

    I probably shouldn't have asked for "text boxes".

    I'd just like to split some text up into two short columns, separated by a vertical line, in the middle of full lines of text like so:


    text text text text text text text text text text text text text text text text
    text text text text text text text text text text text text text text text text
    text text text text text text text text text text text text text text text text

    text text text text text text text text l text text text text text text text
    text text text text text text text text l text text text text text text text
    text text text text text text text text l text text text text text text text
    text text text text text text text text l text text text text text text text

    text text text text text text text text text text text text text text text text
    text text text text text text text text text text text text text text text text
    text text text text text text text text text text text text text text text text

    Can you help me with this?

    thanks again.
     
    chrisj, Aug 12, 2007 IP