I'm trying to fit a TextBox and text inside table cell but each time I set TextBox width to 100% the falls out off line. Right now I'm putting the TextBox and text on separate cells, but if I could make them stay on the same cell without the text falling out of line that would be great. Text length may vary so I can't really set TextBox width to a specific %.
*Sample Current: |TextBox|Sample Text|
*Sample Desired: |TextBox Sample Text|
*Sample with my current code, both TextBox and text in one table cell
|TextBox
Sample Text |
Currently this is what I'm using to resize the TextBox to fit table td:
var tbls1 = [
'tbl-nutritional-histo',
];
for (var tt = 0; tt < tbls1.length; tt++) {
var tbl1 = document.getElementById(tbls1[tt]).getElementsByTagName('input');
// Loop inside elements of current table
for (var ii = 0 ; ii < tbl1.length; ii++) {
// Check if current element is textbox
if (tbl1[ii].type == "text") {
// Set textbox size to 100%
tbl1[ii].style.width = '100%';
}
}
}