GWT. How to change flex table's column width?

Valentyn Grygoriev picture Valentyn Grygoriev · Sep 6, 2013 · Viewed 7.3k times · Source

I can't change width of first column with CheckBoxes in my FlexTable. first column is very wide

I tried to use

filterGrid.getColumnFormatter().setWidth(0, "15px");

but it hadn't any effect.

Please suggest me something.

Appendix 1.

<table class="content" aria-hidden="false">
<colgroup><col width="10px"></col></colgroup>
<tbody>
<tr>
<td>
<span class="gwt-CheckBox" style="width: 1em;">
<input id="gwt-uid-9" type="checkbox" value="on" tabindex="0"></input>
<label for="gwt-uid-9"></label></span>
</td>

Answer

Churro picture Churro · Sep 8, 2013

Try FlexTable.getColumnFormatter().setWidth(column, width);

For example, I just tried table.getColumnFormatter().setWidth(0, "400px");

and that generated the following HTML:

<colgroup>
    <col width="400px">
</colgroup>

enter image description here