try {
    public Box layout(Context c, Element elem) {        try {            //u.p("\n====\nLayout");            // create the table box            TableBox table_box = (TableBox)createBox(c, elem);            // set up the border spacing            float border_spacing = c.css.getFloatProperty(elem,                                                           "border-spacing");            table_box.spacing = new Point((int)border_spacing,                                           (int)border_spacing);            // set up the width            int fixed_width = c.getExtents().width;            if (c.css.hasProperty(elem, "width", false)) {                fixed_width = (int)c.css.getFloatProperty(elem, "width", false);            }            int orig_fixed_width = fixed_width;            //subtract off the margin, border, and padding            fixed_width -= table_box.margin.left + table_box.border.left +                table_box.padding.left + table_box.spacing.x +                 table_box.padding.right + table_box.border.right + table_box.margin.right;            // create the table            Table table = new Table();            table.addTable(elem);            //calculate the widths            table.calculateWidths(fixed_width, c);            //pull out the boxes            Box bx = calculateBoxes(fixed_width, table_box, c, table);            bx.width += table_box.margin.left + table_box.border.left + table_box.padding.left                 + table_box.margin.right + table_box.border.right + table_box.padding.right;            bx.height += table_box.margin.top + table_box.border.top + table_box.padding.top +                table_box.margin.bottom + table_box.border.bottom + table_box.padding.bottom;            //bx.width            return bx;        } catch (Exception ex) {            u.p(ex);            return null;        }    }