tags:

views:

134

answers:

6
<table cellspacing="0" cellpadding="0">

<textarea rows="5" cols="60" name="question"></textarea>

<tr>
 <td><input type="text" readonly="1" value="127.0.0.1" /></td>
 <td><input type="submit" value="Skicka" /></td>
</tr>
</table>

equals to

http://i42.tinypic.com/14j18xz.jpg

How can I do so that the submit button stays where i want it (look pic). If i mess with width of the table it gets completely diffrent in firefox and ie.

+3  A: 

Your textarea is not in a cell. It's between rows, no wonder it's messed up :)

Try:

<table cellspacing="0" cellpadding="0">
<tr>
    <td colspan="2"><textarea rows="5" cols="60" name="question"></textarea>
</tr>

<tr>
 <td><input type="text" readonly="1" value="127.0.0.1" /></td>
 <td><input type="submit" value="Skicka" /></td>
</tr>
</table>
karim79
+3  A: 

Create your table like this:

<table cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">
<textarea rows="5" cols="60" name="question"></textarea>
</td>
</tr>
<tr>
 <td><input type="text" readonly="1" value="127.0.0.1" /></td>
 <td align="right"><input type="submit" value="Skicka" /></td>
</tr>
</table>

Note the colspan="2" and the align="right" attributes on the first and last td element. Also I moved the textarea into a td as well.

nikmd23
Thanks Canavar - for some reason jQuery wasn't downloading for me on SO so I was unable to hit the "code" button. You edited this before I could get back to fix it. I went to JQuery.com to get it in my cache.
nikmd23
Just a comment for moderators: notice that this user did not really answer the question - the anwer came first in an edit, supplied by another user. There might be a good explanation to this, but to me it looks a little suspicious...
Tomas Lycken
Tomas, View source on the first version of this answer - the answer is there but didn't show on the page for some reason.
nikmd23
+4  A: 

Put the <textarea> in a table cell:

<table cellspacing="0" cellpadding="0">
<tr><td colspan="2">
    <textarea rows="5" cols="60" name="question"></textarea>
 </td><tr>
 <td><input type="text" readonly="1" value="127.0.0.1" /></td>
 <td><input type="submit" value="Skicka" /></td>
</tr>
</table>
Tomas Lycken
Beat me to it. :)
Eric Wendelin
+2  A: 

You'll want to put that textarea into a table cell with colspan="2" to get the desired effect.

Bonus points if you use CSS instead of a table for this ;)

Eric Wendelin
+1  A: 

Your textarea needs to be in a table row as well. Not tested, but try this:

<table cellspacing="0" cellpadding="0">
 <tr>
  <td colspan="2">
   <textarea rows="5" cols="60" name="question"></textarea>
  </td>
 </tr>
 <tr> 
  <td>
   <input type="text" readonly="1" value="127.0.0.1" />
  </td>
  <td>
   <input type="submit" value="Skicka" />
  </td>
 </tr>
</table>
Anna Lear
+1  A: 

I'm not sure, but first try putting the textarea in a cell, like this:

<tr>
<td colspan="2">
<textarea>Stuff</textarea>
</td>
</tr>
Javier Badia