this.x += midpoint - getContentWidth() / 2;
calcX = midpoint - (getContentWidth() + getContentStart()) / 2;
    public void align() {    	if (getFloatDistances() == null) {    		// Shouldn't happen (but currently can with nested tables)    		XRLog.layout(Level.WARNING, "Float distances not available. Cannot align.");    		return;    	}    	        IdentValue align = getParent().getStyle().getCalculatedStyle().getIdent(CSSName.TEXT_ALIGN);                // TODO implement text-align: justify                int current = this.x;                if (align == IdentValue.LEFT || align == IdentValue.JUSTIFY) {            int floatDistance = getFloatDistances().getLeftFloatDistance();            this.x += floatDistance;        } else if (align == IdentValue.CENTER) {            int leftFloatDistance = getFloatDistances().getLeftFloatDistance();            int rightFloatDistance = getFloatDistances().getRightFloatDistance();                        int midpoint = leftFloatDistance +                (getParent().getContentWidth() - leftFloatDistance - rightFloatDistance) / 2;                        this.x += midpoint - getContentWidth() / 2;        } else if (align == IdentValue.RIGHT) {            int floatDistance = getFloatDistances().getRightFloatDistance();            this.x += getParent().getContentWidth() - floatDistance - getContentWidth();        }                if (current != this.x) {            calcCanvasLocation();            calcChildLocations();        }    }