Forum Moderators: open

Message Too Old, No Replies

Textarea affects size of table columns.

         

edacsac

4:51 pm on Jun 8, 2007 (gmt 0)

10+ Year Member



I guess this question is good for both the htm and css forums, but I will post it here.

I've been getting away from tables, but I have a page that uses a table with good reason. I have my table layout sized to fit everything perfect and look good. Now I'm going back and adding a <textarea> inside a <div> inside a <td>. Right now the table is 2 columns. I add the div with a width of "auto" and it fits the table cell perfect. I add the textarea inside the div, the textarea being way smaller than the available space inside the <td> and <div>, but the table column sizes get messed up. I have the colum sizes declared in the <td> tags. The column that the textarea is NOT in, gets shrunk, even though the textarea has plenty of room. Any ideas?

Brett_Tabke

6:11 pm on Jun 8, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



post the bare minimum code and lets have a look.

edacsac

8:56 pm on Jun 8, 2007 (gmt 0)

10+ Year Member



Here we are:

<div class="checklist" style="padding: 15px;">
<table border="1">
<tr bgcolor="<? echo $bg2;?>" id="tr_laa">
<td class="checklistTd" width="300">
Yes&nbsp;<input type="radio" name="cl_laa" id="cl_laa" value="1" <?if($_POST['cl_laa']=='1'){echo "checked";}?>>
No&nbsp;<input type="radio" name="cl_laa" id="cl_laa" value="2" <?if($_POST['cl_laa']=='2'){echo "checked";}?>>
N/A&nbsp;<input type="radio" name="cl_laa" id="cl_laa" value="3" <?if($_POST['cl_laa']=='3'){echo "checked";}?>>
</td>
<td class="checklistTd" width="488">Blah <b>Bold blah. Bold blah. Bold blah. Bold blah.<div class="commentboxPop"><textarea cols="40" rows="3">Textarea default text</textarea></div></td>
</tr>
</table>
</div>

.checklistTd {
padding-left: 2px;
padding-bottom: 10px;
font: 11px; Verdana, Arial, Helvetica, sans-serif;
color: #333;
text-align: left;
vertical-align: top;
}
.checklist {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11pt;
color: #333;
text-align: left;
vertical-align: top;
}

Brett_Tabke

12:50 am on Jun 9, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



What browser are you testing in?

encyclo

1:10 am on Jun 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't reproduce the error in IE6, Firefox 1.5 or Konqueror 3.5 with the example code you supplied. What are the CSS rules for
commentboxPop
? You mention
width:auto;
for the
div
but that should be unnecessary as it is the default setting.

edacsac

9:32 pm on Jun 11, 2007 (gmt 0)

10+ Year Member



Thanks for the replies everyone. Since encyclo can't reproduce it, I decided not to troubleshoot this one. It's quicker to just do something different. I thought there may have been a known issue or something like that. Thanks again!