0

I got row with cells that have position:relative', inside them I got select elements with position:absolute. The problem is when I add for example top:0 the select is going to top of page and not to top of table cell -Why??

<div class='content'>
...
<tr class="search">
<td>...</td><td>...</td><td>
<select name="source" id="id_source" class="ui-corner-all" multiple="multiple">
<option value="1">Test1</option>
</select>
</td>
<td>
<select name="owner" id="id_owner" class="ui-corner-all" multiple="multiple">
<option value="1">admin</option>
<option value="2">Janusz</option>
</select></td></tr>
...
</div>

and css

.search td {
position:relative;
vertical-align: top;
width: auto;
height: auto;
}
.content select[multiple=multiple]{
height:1.5em;
background-color:#D4CCB0;
position: absolute;
padding:4px;
top:0px
}
Lord_JABA
  • 2,545
  • 7
  • 31
  • 58
  • 1
    Your code works fine for me in Chrome but not in FF. This appears to be a known 13+ year old bug with FF (see http://davidwalsh.name/table-cell-position-absolute and http://stackoverflow.com/questions/7256004/firefox-issue-with-displayabsolute-in-a-table-cell). Example of it working in Chrome http://jsfiddle.net/j08691/zZCYx/ – j08691 Apr 23 '14 at 14:20
  • possible duplicate of [Does Firefox support position: relative on table elements?](http://stackoverflow.com/questions/5148041/does-firefox-support-position-relative-on-table-elements) – James Montagne Apr 23 '14 at 14:36
  • currently I use workaround enclosing selects in `
    `
    – Lord_JABA Apr 23 '14 at 14:54

1 Answers1

0

when I comment out top:0;, the select boxes go into their place

http://jsfiddle.net/

Pixel Rubble
  • 1,104
  • 3
  • 14
  • 26