/** * @return <code>true</code> if this is a star column (width == "*") */ default boolean isStar () { return CHTMLAttributeValues.STAR.equals (getWidth ()); }
/** * Set the width in pixel. * * @param nWidth * Pixel width. * @return this */ @Nonnull default IMPLTYPE setWidth (@Nonnegative final int nWidth) { return setWidth (Integer.toString (nWidth)); }
@Override protected void onFinalizeNodeState (@Nonnull final IHCConversionSettingsToNode aConversionSettings, @Nonnull final IHCHasChildrenMutable <?, ? super IHCNode> aTargetNode) { super.onFinalizeNodeState (aConversionSettings, aTargetNode); /* * bug fix for IE9 table layout bug * (http://msdn.microsoft.com/en-us/library/ms531161%28v=vs.85%29.aspx) IE9 * only interprets column widths if the first row does not use colspan (i.e. * at least one row does not use colspan) */ if (m_aColGroup != null && m_aColGroup.hasColumns () && hasBodyRows () && getFirstBodyRow ().isColspanUsed ()) { // Create a dummy row with explicit widths final HCRow aRow = new HCRow (false).addClass (CSS_FORCE_COLSPAN); for (final IHCCol <?> aCol : m_aColGroup.getAllColumns ()) { final IHCCell <?> aCell = aRow.addAndReturnCell (HCEntityNode.newNBSP ()); final int nWidth = StringParser.parseInt (aCol.getWidth (), -1); if (nWidth >= 0) aCell.addStyle (CCSSProperties.WIDTH.newValue (ECSSUnit.px (nWidth))); } addBodyRowAt (0, aRow); } }
/** * Set the width in percent. * * @param dPerc * percentage width. * @return this */ @Nonnull default IMPLTYPE setWidthPerc (@Nonnegative final double dPerc) { return setWidth (ECSSUnit.perc (dPerc)); }