I have a table that contains another small table in a cell:
<table id="big" style='width: 100%'>
<tr>
..
<td>..</td>
..
</tr>
<tr>
..
<td style='width: 75px'>
<table style='width: 100%'>
<tr>
<td style='width: 33%'><select></select></td>
<td style='width: 33%'><select></select></td>
<td style='width: 33%'><select></select></td>
</tr>
</table>
</td>
..
</tr>
</table>
As you can see, I have a small table which should take the whole outer cell. This table should be divided into 1x3 cells, each containing a select combo box.
Now the inner table always takes too big width than specified, corrupting the outer table GUI.
As you can see, I have tried to limit the outer cell width in pixels, without any success.
To adjust table row and column size in Word: Click anywhere in the table. In "Table Tools" click the [Layout] tab > locate the "Cell Size" group and choose from of the following options: To fit the columns to the text (or page margins if cells are empty), click [AutoFit] > select "AutoFit Contents."
Lock or unlock the size of cells Click the Table Tools Layout tab, and do one of the following: To lock the cell size, clear the Grow to Fit Text check box. To unlock the cell size, select the Grow to Fit Text check box.
To set the cell width and height, use the CSS style. The height and width attribute of the <td> cell isn't supported in HTML5. Use the CSS property width and height to set the width and height of the cell respectively. Just keep in mind, the usage of style attribute overrides any style set globally.
You need to specify fixed table layout to respect column width even if content needs more space:
table {
table-layout: fixed;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With