Child element with 100% width for table with auto width columns
I have a HTML table. Table already contains one row with two columns. Columns width are perfect for me. But afterwards using JS I add new row to the table with input element which I want to fill the cell as content for first cell and columns width changed.
Easier to show rather than describ开发者_Go百科e:
http://dl.dropbox.com/u/15612314/Layout.pngThe question it how to keep previous width for columns without explicit setting width for all columns?
Thanks
You can leverage jquery to acheive this, since you are already using javascript. Ading something this will do:
<script type="text/javascript">
$(function() {
$("input:text").css("width", "100%")
})
</script>
精彩评论