Posted by: songbard | September 5, 2008

HTML : Problem with table tags in IE

The other day was having problem displaying an select option list inside a table cell alongwith cell header in IE whereas the same worked fine in FireFox.

The table was something like ;

<table>

<tr>

<th> Cell Header </th>

<td>

<select name = “name” id=”id”>

<option value=”1″> 1 </option>

……………………………………………..

<option value=”n”> n </option>

</select>

</td>

</tr>

</table>

The string Cell Header ate up all the space and the subsequent drop down list did not show up in IE.


Solution was to specify width for table and cell:

<table style = “width :20%”>

<tr>

<th> Cell Header </th>

<td style = “width :80%”>

<select name = “name” id=”id”>

<option value=”1″> 1 </option>

……………………………………………..

<option value=”n”> n </option>

</select>

</td>

</tr>

</table>

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: