Horizontal align center in table-cell

Hello,
I'm having a problem getting to horizontally align a div (schilderij) in another div (schilderijholder).
This schilderij div has a height and width of 480px and has display: table-cell. The content of this div is an image, with different sizes on every page (there are multiple pages, it is some sort of photogallery). The images are nicely centered, horizontally and vertically, inside this div.
The containing div (schilderijholder), has a width of 100% of it's containing block, which has a variable size
The problem is, I cant get the schilderij div horizontally centered in the schilderijholder div.
Here's the simplified code. If you need the whole code, I can post that too.
    <div class="leftWrapper" style="clear: none; float: left; width: 68%; height: 100%;">
    <div class="content" style="margin: 40 10 50 30;">
      <div id="schilderijholder" style="text-align: center; width: 100%; height: 100%;">
          <div id="schilderij" style=" height: 480px; width: 480px; text-align: center; vertical-align: middle; display: table-cell;">
            <img src="../Assets/Schilderijen/normal/01.jpg" width="399" height="480" align="center" />
            </div>
          </div>
        <div id="pageControl">
        <span class="left">
          <a href="schilderijen2.html"></a> </span>
          <span class="right">
          <a href="02.html">Volgende</a>
            </span>
          </div>
      </div>
     </div>
What I've tried:
     - "margin: 0 auto;" on the schilderij div
     - "position: relative;" on the schilderijholder div and "position: absolute; left: 50%; margin-left: -240px;" on the schilderij div
But these both don't work.
Does anybody know a solution for this, or maybe has something to put me on the right way?
Thanks in advance!

Let's fix your code first:
<div class="leftWrapper" style="float: left; width: 68%; height: 100%;">
    <div class="content" style="margin: 40px 10px 50px 30px;">
      <div id="schilderijholder" style="text-align: center; width: 100%; height: 100%;">
          <div id="schilderij" style=" height: 480px; width: 480px; text-align: center; vertical-align: middle; display: table-cell;">
            <img src="../Assets/Schilderijen/normal/01.jpg" width="399" height="480" align="center" />
            </div>
          </div>
        <div id="pageControl">
        <span class="left">
          <a href="schilderijen2.html"></a> </span>
          <span class="right">
          <a href="02.html">Volgende</a>
            </span>
          </div>
      </div>
     </div>
Why do you need the div#schilderij at all?  Seems unnecessary to me.
Then you would need the display:table-cell on the parent to this div, not on the div#schilderij, which has basically the same dimensions as the image.  But I think this is all too complicated.  Why not just this?
<div class="leftWrapper" style="float: left; width: 68%;">
    <div class="content" style="margin: 40px 10px 50px 30px;">
      <div id="schilderijholder" style="text-align: center;">
            <img src="../Assets/Schilderijen/normal/01.jpg" width="399" height="480" align="center" />
            </div>
          </div>
        <div id="pageControl">
        <span class="left">
          <a href="schilderijen2.html"></a> </span>
          <span class="right">
          <a href="02.html">Volgende</a>
            </span>
          </div>
      </div>
     </div>

Similar Messages

  • Images not aligning properly in table cells

    I have a simple table (1 row, 4 columns).
    Three of the images have identical dimensions (108 x 200 pixels). After placing them each into a cell of the table, the middle image is not aligned with the other two. Instead, it is higher in the cell.
    I looked at source code, and everything appears to be identical. Also, every image has the default setting for alignment (center, middle).
    How can I fix this?
    Thanks

    OK thanks for posting a link to your site.  The error is in Line 73 .  The code snippet looks like this:
    Click on the above picture to get a magnified version of it and you will see that in Line 73 you have something like this:
    & nbsp;
    Delete it and your problem is solved.
    Good luck.

  • Horizontal alignment of main table in index file

    I have a 3 page website that I am developing.  After creating the first page I just resaved it 3 times and saved the pages individually.  After I was done, two of the pages come up in the same position horizontally centered, but the main index page is just slightly off.  The table is set up to 800 px on each page.  Any thoughts on what could be causing this?

    Is the content on the main page longer than the content on the other two? Your scroll bar will push the table over a few pixels. Always best to post a link to the site when possible as well.
    Brad Lawryk
    Adobe Community Expert, Dreamweaver
    Adobe Usergroup Manager, Northern British Columbia Adobe User Group

  • Why does Vertical Align Center align objects along the horizontal?

    And why does Horizontal Align Center align objects along the vertical?
    -g-
    P.S. Please please please make the Eydropper tool available by function key so I can toggle to it while using the Text tool. Please!

    g,
    but when I select two objects and click the vertical align button they snap to an invisible horizontal line
    This is (almost) identical to:
    Because (the centres of) vertically aligned objects will be on the same horizontal level/line.
    And that is just one way of expressing what vertical alignment means. Here are a few others:
    Their centres have the same height,
    Their centres have the same Y value on the Artboard/Workspace,
    In all cases, you can draw a horizontal line through their centres.
    Mathematically, Y = C (Y is a constant value C) is the equation for a horizontal line.

  • "horizontal/vertical align center" relative to one object, not the average

    Hello!
    I see in Illustrator, if i select 2 objects and i choose to align them relative to their centers, both objects will move to the middle point of the distance between their original positions.
    Is there a way to make just one of them move?
    Am i able to center one object to another object that is already in its final position?
    thanks a lot!

    i tried it, but it doesn't work. here's what i did:
    -selected one object
    -shift-selected the other one
    -clicked horizontal align center
    both objects moved
    (i am using CS3)

  • Getting text to the top of a table cell

    I'm sorry, I have asked this before but I still have nothing that works.
    In a table I want the text to start at the top of the cell. I can force it with a clear gif and the end, but surely that is not right. It often works OK in Safari and Opera, but not in Firefox or IE.
    I have copied some code below. It seems to me that the text should be aligning top, but it remain vertically centred in live view and all browsers (MAC).
    What am I not seeing?
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <link href="properllers.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <table width="880" border="0" align="center" cellpadding="0" cellspacing="0" class="top">
      <tr>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td height="500"> </td>
        <td> </td>
        <td><h1 class="top">Text test header</h1>
          <p class="top">Berci accuptatet facerum, simus, quatiae pori tem arum id et exces aute erum inciumquo temquos essi nem utam, int aut harionsequo entintius solum est in consequo odi dolenimpe laborum se vel iliquo voluptas ex entorerum rest venimaxima sit am aut arumquam, tet que necererchil et mo vid ut mo ilic totaquam apitatem. Et illaboratum hilleni hillab iusaperunt landunt inctat.<br />
            Mus, ut eum ut ut omni qui aliquas peribus.<br />
        Us repudit, volupti ssequid modionseque pero consernatur? Qui que volorei umquae dem aut hilis am, cus, sequam quid ullam, idera della vent errovitis nobis minia simus et quos eum de cuptaec turiorio. Nequaspercia alis andae moluptae. Vid quunt enihit la nempores volupta alibus, occaborum ist odi volorepres que eum quo id underio tem res dolute omnienis in porro imoluptas doluptat im faccus re porem rero comnihicim e</p></td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
    </table>
    </body>
    </html>

    The default alignment in a table cell is LEFT MIDDLE, i.e., left horizontal and middle vertical.  If you have no specification in your code for anything other than that, then that's what you get.  I see no such specifications in your code, so your symptoms are not surprising.  To make things align to the top of a table cell (in HTML4.01) you would use <td valign="top"> or in XHTML you would use CSS to bring the content to the top of the cell, e.g., <td style="vertical-align:top"> (inline CSS shown for clarity).
    Be aware that text contained within a paragraph or an <h#> tag WILL HAVE A TOP MARGIN, so if you want that text to be flush with the top of the cell, you will have to control that top margin on the container tag, too.
    In your case, I'm assuming that this is one of your attempts to get to the top of the cell -
    <td><h1 class="top">Text test header</h1>
    But we have no idea what rule is specified by the class="top".  At any rate, you will have only affected the alignment of the text within the <h1> tag and not within the table cell by that.  Perhaps <td class="top"> would be better?  But best would be (if you wanted ALL content in the table to be at the top of the cells) to use a descendent selector like -
    table#whatever td { vertical-align:top; }
    and then give that table the id="whatever".

  • Table cell with invisible border?

    Hi,
    I am trying to get table-cells with e.g. the right
    border missing (invisible). I am using the
    following XSL-FO to get this:
    <fo:table-cell border="solid black 1px" border-right-width="0px" border-collapse="collapse" number-columns-spanned="1">
    This works fine with four different
    XSL-FO engines, but XMLP shows
    the right border. Is there a work around
    or different approach to get invisible
    borders?
    Thank you,
    Heinz

    Hi Tim,
    I am using an RTF template, but was not able to get
    what I need with the standard functionality available
    in the RTF template. To work around this, I have
    imported a stylesheet to create the FO for the table
    directly. I try to append to this mail:
    - code in the RTF template
    - XML sample data
    - stylesheet imported from RTF template
    - the generated FO (small table, 4 colums, 7 rows, plus headers)
    I could also provide a stylesheet to create a complete,
    self containing FO and a correct PDF output, but may
    direct mail would be better for this.
    Thank you,
    Heinz
    TemplateBuilder.RTF:
    <?start:body?>
    <?import: file:///F:/OracleForum/create_a_table.xsl?>
    <?for-each:/Sample_Data/Measured_Values?>
    <?call@inlines: parameterGroupIndividual?><?end call?>
    <?end for-each?>
    <?end body?>
    XML Data:
    <?xml version="1.0" encoding="UTF-8"?>
    <Sample_Data>
         <Measured_Values>
              <Param_Group>GENERAL PARAMGROUP<Parameter Unit="umol/l">BILIU<Item Measured="6.8">1</Item>
                        <Item Measured="8.2">2</Item>
                        <Item Measured="-">3<Value_Note>
                                  <number>*</number>
                                  <text>A sample footnote</text>
                             </Value_Note>
                        </Item>
                        <Item Measured="62.1">4</Item>
                        <Item Measured="215.9">5</Item>
                        <Item Measured="12.7">6<Item_Note>
                                  <number>a</number>
                                  <text>An Item footnote</text>
                             </Item_Note>
                        </Item>
                        <Item Measured="3.6">7</Item>
                   </Parameter>
                   <Parameter Unit="per ul">ERYU<Item Measured="7.210">1</Item>
                        <Item Measured="45.000">2<Value_Note>
                                  <number>**</number>
                                  <text>Another sample footnote</text>
                             </Value_Note>
                        </Item>
                        <Item Measured="-">3</Item>
                        <Item Measured="1234.000">4</Item>
                        <Item Measured="326.580">5</Item>
                        <Item Measured="3.658">6</Item>
                        <Item Measured="123.540">7</Item>
                   </Parameter>
                   <Parameter Unit="per ul">LEUU<Item Measured="3.00">1</Item>
                        <Item Measured="3.00">2</Item>
                        <Item Measured="-">3</Item>
                        <Item Measured="354.39">4</Item>
                        <Item Measured="3254.24">5</Item>
                        <Item Measured="1256.32">6</Item>
                        <Item Measured="326.54">7</Item>
                   </Parameter>
              </Param_Group>
              <Param_Group>CRYSTALS<Parameter Unit="umol/l">GLUHI<Item Measured="22.00">1</Item>
                        <Item Measured="5.12">2</Item>
                        <Item Measured="-">3</Item>
                        <Item Measured="23.14">4<Value_Note>
                                  <number>***</number>
                                  <text>A last footnote</text>
                             </Value_Note>
                        </Item>
                        <Item Measured="576.26">5</Item>
                        <Item Measured="3621.00">6</Item>
                        <Item Measured="0.37">7</Item>
                   </Parameter>
              </Param_Group>
         </Measured_Values>
    </Sample_Data>
    create_a_table.xsl:
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
         <xsl:output method="xml" version="1.0" indent="no" encoding="ISO-8859-1"/>
         <!-- -->
         <xsl:template name="parameterGroupIndividual">
              <xsl:call-template name="doParameterGroupTables">
                   <xsl:with-param name="currentNodeSet" select="*"/>
                   <xsl:with-param name="currentNodeChilds" select="*[1]/Parameter"/>
              </xsl:call-template>
         </xsl:template>
         <!-- -->
         <xsl:template name="doParameterGroupTables">
              <xsl:param name="currentNodeSet"/>
              <xsl:param name="currentNodeChilds"/>
              <fo:table border="solid black 1px" table-layout="fixed">
                   <!-- The "Item" column -->
                   <fo:table-column column-width="2.5cm"/>
                   <!-- Create required columns 80% space for values, 20% space for footnotes -->
                   <xsl:call-template name="defineColumnsForNode">
                        <xsl:with-param name="nodeSet" select="$currentNodeSet"/>
                        <xsl:with-param name="nodeSetChilds" select="$currentNodeChilds"/>
                        <xsl:with-param name="colWidth" select="2.4"/>
                   </xsl:call-template>
                   <fo:table-header>
                        <fo:table-row>
                             <fo:table-cell border="solid black 0px" border-collapse="collapse" number-columns-spanned="1">
                                  <fo:block> </fo:block>
                             </fo:table-cell>
                             <xsl:call-template name="doParameterGroupHeaders">
                                  <xsl:with-param name="nodeSet" select="$currentNodeSet"/>
                             </xsl:call-template>
                        </fo:table-row>
                        <fo:table-row>
                             <fo:table-cell>
                                  <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">Item</fo:block>
                             </fo:table-cell>
                             <xsl:call-template name="defineSecondRowOfHeaders">
                                  <xsl:with-param name="nodeSet" select="$currentNodeSet"/>
                                  <xsl:with-param name="nodeSetChilds" select="$currentNodeChilds"/>
                             </xsl:call-template>
                        </fo:table-row>
                   </fo:table-header>
                   <fo:table-body>
                        <xsl:for-each-group select="*/Parameter/Item" group-by="normalize-space(text())">
                             <fo:table-row>
                                  <fo:table-cell border="solid black 2px" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center">
                                            <xsl:value-of select="./text()"/>
                                       </fo:block>
                                  </fo:table-cell>
                                  <xsl:for-each select="current-group()">
                                       <fo:table-cell border="solid black 2px" border-left-width="1px" border-collapse="collapse" number-columns-spanned="1">
                                            <fo:block font-family="sans-serif" font-size="9pt" text-align="right">
                                                 <xsl:value-of select="./@Measured"/>
                                            </fo:block>
                                       </fo:table-cell>
                                       <fo:table-cell border="solid black 2px" border-right-width="1px" border-collapse="collapse" number-columns-spanned="1">
                                            <fo:block font-family="sans-serif" font-size="9pt" text-align="left">
                                                 <xsl:value-of select="./Value_Note/number/text()"/>
                                            </fo:block>
                                       </fo:table-cell>
                                  </xsl:for-each>
                             </fo:table-row>
                        </xsl:for-each-group>
                   </fo:table-body>
              </fo:table>
         </xsl:template>
         <!-- -->
         <xsl:template name="doParameterGroupHeaders">
              <xsl:param name="nodeSet"/>
              <xsl:if test="$nodeSet[1]">
                   <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="{count($nodeSet[1]/Parameter)*2}">
                        <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">
                             <xsl:value-of select="$nodeSet[1]/text()"/>
                        </fo:block>
                   </fo:table-cell>
                   <xsl:call-template name="doParameterGroupHeaders">
                        <xsl:with-param name="nodeSet" select="$nodeSet[1]/following-sibling::*"/>
                   </xsl:call-template>
              </xsl:if>
         </xsl:template>
         <!-- -->
         <xsl:template name="defineSecondRowOfHeaders">
              <xsl:param name="nodeSet"/>
              <xsl:param name="nodeSetChilds"/>
              <xsl:choose>
                   <xsl:when test="$nodeSetChilds[1]">
                        <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="2">
                             <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">
                                  <xsl:value-of select="$nodeSetChilds[1]/text()"/>
                             </fo:block>
                             <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">
                                  <xsl:value-of select="$nodeSetChilds[1]/@Unit"/>
                             </fo:block>
                        </fo:table-cell>
                        <xsl:call-template name="defineSecondRowOfHeaders">
                             <xsl:with-param name="nodeSet" select="$nodeSet"/>
                             <xsl:with-param name="nodeSetChilds" select="$nodeSetChilds[1]/following-sibling::*"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:when test="$nodeSet[1]/following-sibling::*">
                        <xsl:call-template name="defineSecondRowOfHeaders">
                             <xsl:with-param name="nodeSet" select="$nodeSet[1]/following-sibling::*"/>
                             <xsl:with-param name="nodeSetChilds" select="$nodeSet[1]/following-sibling::*[1]/Parameter"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:otherwise>
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <!-- -->
         <xsl:template name="setValuesPGroupChilds">
              <xsl:param name="nodeSet"/>
              <xsl:param name="nodeSetChilds"/>
              <xsl:param name="ItemNumber"/>
              <xsl:choose>
                   <xsl:when test="$nodeSetChilds[1]/Item[text()=$ItemNumber]">
                        <fo:table-cell border="solid black 1px" border-right-width="0px" border-collapse="collapse" number-columns-spanned="1">
                             <fo:block font-family="sans-serif" font-size="9pt" text-align="right">
                                  <xsl:value-of select="$nodeSetChilds[1]/Item[text()=$ItemNumber]/@Measured"/>
                             </fo:block>
                        </fo:table-cell>
                        <fo:table-cell border="solid black 1px" border-left-width="0px" border-collapse="collapse" number-columns-spanned="1">
                             <fo:block font-family="sans-serif" font-size="9pt" text-align="left">
                                  <xsl:value-of select="$nodeSetChilds[1]/Item[text()=$ItemNumber]/Value_Note/number/text()"/>
                             </fo:block>
                        </fo:table-cell>
                        <xsl:call-template name="setValuesPGroupChilds">
                             <xsl:with-param name="nodeSet" select="$nodeSet"/>
                             <xsl:with-param name="nodeSetChilds" select="$nodeSetChilds[1]/following-sibling::*"/>
                             <xsl:with-param name="ItemNumber" select="$ItemNumber"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:when test="$nodeSet[1]/following-sibling::*">
                        <xsl:call-template name="setValuesPGroupChilds">
                             <xsl:with-param name="nodeSet" select="$nodeSet[1]/following-sibling::*"/>
                             <xsl:with-param name="nodeSetChilds" select="$nodeSet[1]/following-sibling::*[1]/Parameter"/>
                             <xsl:with-param name="ItemNumber" select="$ItemNumber"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:otherwise>
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <!-- -->
         <xsl:template name="defineColumnsForNode">
              <xsl:param name="nodeSet"/>
              <xsl:param name="nodeSetChilds"/>
              <xsl:param name="colWidth"/>
              <xsl:choose>
                   <xsl:when test="$nodeSetChilds[1]">
                        <fo:table-column column-width="{$colWidth*0.8}cm"/>
                        <fo:table-column column-width="{$colWidth*0.2}cm"/>
                        <xsl:call-template name="defineColumnsForNode">
                             <xsl:with-param name="nodeSet" select="$nodeSet"/>
                             <xsl:with-param name="nodeSetChilds" select="$nodeSetChilds[1]/following-sibling::*"/>
                             <xsl:with-param name="colWidth" select="$colWidth"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:when test="$nodeSet[1]/following-sibling::*">
                        <xsl:call-template name="defineColumnsForNode">
                             <xsl:with-param name="nodeSet" select="$nodeSet[1]/following-sibling::*"/>
                             <xsl:with-param name="nodeSetChilds" select="$nodeSet[1]/following-sibling::*[1]/Parameter"/>
                             <xsl:with-param name="colWidth" select="$colWidth"/>
                        </xsl:call-template>
                   </xsl:when>
                   <xsl:otherwise>
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <!-- -->
         <!-- create $noOfCols empty table-cells -->
         <!-- -->
         <xsl:template name="fillColumns">
              <xsl:param name="noOfCols"/>
              <xsl:if test="$noOfCols > 0">
                   <fo:table-cell border-right-style="dashed" border-left-style="dashed" border-width="1px">
                        <fo:block/>
                   </fo:table-cell>
                   <xsl:variable name="rest" select="$noOfCols - 1"/>
                   <xsl:call-template name="fillColumns">
                        <xsl:with-param name="noOfCols" select="$rest"/>
                   </xsl:call-template>
              </xsl:if>
         </xsl:template>
    </xsl:stylesheet>
                   <fo:table border="solid black 1px" table-layout="fixed">
                        <fo:table-column column-width="2.5cm"/>
                        <fo:table-column column-width="1.92cm"/>
                        <fo:table-column column-width="0.48cm"/>
                        <fo:table-column column-width="1.92cm"/>
                        <fo:table-column column-width="0.48cm"/>
                        <fo:table-column column-width="1.92cm"/>
                        <fo:table-column column-width="0.48cm"/>
                        <fo:table-column column-width="1.92cm"/>
                        <fo:table-column column-width="0.48cm"/>
                        <fo:table-header>
                             <fo:table-row>
                                  <fo:table-cell border="solid black 0px" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block> </fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="6">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">GENERAL PARAMGROUP</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="2">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">CRYSTALS</fo:block>
                                  </fo:table-cell>
                             </fo:table-row>
                             <fo:table-row>
                                  <fo:table-cell>
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">Item</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="2">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">BILIU</fo:block>
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">umol/l</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="2">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">ERYU</fo:block>
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">per ul</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="2">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">LEUU</fo:block>
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">per ul</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="2">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">GLUHI</fo:block>
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center" font-weight="bold">umol/l</fo:block>
                                  </fo:table-cell>
                             </fo:table-row>
                        </fo:table-header>
                        <fo:table-body>
                             <fo:table-row>
                                  <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center">1</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">6.8</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">7.210</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">3.00</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">22.00</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                             </fo:table-row>
                             <fo:table-row>
                                  <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center">2</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">8.2</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">45.000</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left">**</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">3.00</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">5.12</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                             </fo:table-row>
                             <fo:table-row>
                                  <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center">3</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">-</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left">*</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">-</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">-</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">-</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                             </fo:table-row>
                             <fo:table-row>
                                  <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center">4</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">62.1</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">1234.000</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">354.39</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">23.14</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left">***</fo:block>
                                  </fo:table-cell>
                             </fo:table-row>
                             <fo:table-row>
                                  <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center">5</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">215.9</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">326.580</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">3254.24</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">576.26</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                             </fo:table-row>
                             <fo:table-row>
                                  <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center">6</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">12.7</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">3.658</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">1256.32</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">3621.00</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                             </fo:table-row>
                             <fo:table-row>
                                  <fo:table-cell border="solid black 1px" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="center">7</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">3.6</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">123.540</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">326.54</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-end-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="right">0.37</fo:block>
                                  </fo:table-cell>
                                  <fo:table-cell border="solid black 1px" border-start-style="none" border-collapse="collapse" number-columns-spanned="1">
                                       <fo:block font-family="sans-serif" font-size="9pt" text-align="left"/>
                                  </fo:table-cell>
                             </fo:table-row>
                        </fo:table-body>
                   </fo:table>

  • "Vertical Align Center" Text and a Shape

    Hi designers,
    I wonder if anyone could give me a hand with aligning text and shapes? I would like to align a number to the center of a circle. "Horizontal Align Center" works well. "Vertical Align Center", however, does not yield the desired result. The number turns out to be higher in the cycle (see figure below). The distance from the top of the circle to the top of the number zero, X, is shorter than the distance between the bottom of the circle and the bottom of the number zero. Is it possible to equal these two distances?
    Figure 1: The Outcome of Vertical Align Center
    Thanks,
    Haobo

    Hi Mylenium,
    Thank you very much for you very prompt reply, which solves the problem very effectively.
    If you do not mind, I have got two further questions.
    Firstly, is there an option similar to "Align to Path: Centre" under "Type on a Path Options" that changes how text is aligned?
    Secondly, does InDesign offer the aforementioned function?
    I sometimes label a large quantity of locations with alphanumeric characters, which are subject to frequent changes, and therefore would like to preserve the text if possible. I have heard that manipulating text is InDesign's area of expertise. If this function is not available in Illustrator but offered by InDesign, I can jot down another reason for acquiring the latter and split the workflow in the future.
    Thanks,
    Haobo

  • Horizontal alignment for Text of Header Region

    Hi,
    The content of Text property for a header Region appears left aligned by default.
    Is it possible to set horizontal Alignment = Middle(of the Page)For the Item Type, Header I do not see any property called Horizontal Alignment in the Property Inspector.
    Thanks,
    Gowtam.

    Header component does not expose any property to align the text.
    Can you check whether, the following layout helps.
    TableLayout (Horizontal Alignment - center)
    |
    -- RowLayout (Horizontal Alignment - center)
    |
    --- CellFormat (Horizontal Alignment - center)
    |
    ---- Header

  • Control horizontal alignment of table cell?

    Is it possible to control the horizontal alignment of text within a table cell using some form of xsl:attribute code? I wasn't able to find any alignment attributes supported in the user guide and was hoping there was a way to manage it- the problem is that I don't know ahead of time which cells need to be left justified and which ones need to be centered.
    Thanks,
    Kevin

    I've tried the following in the
    advanced properties but with no success.
    <?if:number(EMPID)>6?>
    <xsl:attribute
    xdofo:ctx="block" name="text-align">center
    </xsl:attribute>
    <?end if?>
    Change the attribute to the following and the formatting works.
    <?if:number(EMPID)>6?>
    <xsl:attribute
    xdofo:ctx="block" name="background-color">red
    </xsl:attribute>
    <?end if?>
    I'm previewing in PDF.
    If anyone has any ideas they would be greatly appreciated.
    Thankyou
    John.

  • Custom Table Cell Renderer Unable To Set Horizontal Alignment

    Hello,
    I have a problem that I'm at my wit's end with, and I was hoping for some help.
    I need to render the cells in my table differently (alignment, colors, etc) depending on the row AND the column, not just the column. I've got this working just fine, except for changing the cell's horizontal alignment won't work.
    I have a CustomCellRenderer that extends DefaultTableCellRenderer and overrides the getTableCellRendererComponent() method, setting the foreground/background colors and horizontal alignment of the cell based on the cell's value.
    I have a CustomTable that extends JTable and overrides the getCellRenderer(int row, int column) method to return a private instance of this CustomCellRenderer.
    This works fine for foreground/background colors, but my calls to setHorizontalAlignment() in the getTableCellRendererComponent() seem to have no effect, every cell is always displayed LEFT aligned! It's almost like the cell's alignment is determined by something else than the table.getCellRenderer(row,column).getTableCellRendererComponent() method.
    I've also tried setting the renderer for every existing TableColumn in the TableModel to this custom renderer, as well as overriding the table's getDefaultColumn() method to return this custom renderer as well for any Class parameter, with no success.
    No matter what I've tried, I can customize the cell however I want, EXCEPT for the horizontal alignment!!!
    Any ideas???
    Here's the core custom classes that I'm using:
    class CustomTable extends JTable {
    private CustomRenderer customRenderer = new CustomRenderer();
    public CustomTable() {
    super();
    public TableCellRenderer getCellRenderer(int row, int column) {
    return customRenderer;
    } // end class CustomTable
    class CustomRenderer extends DefaultTableCellRenderer {
    public CustomRenderer() {
    super();
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
    if (row % 2 == 0) {
    setForeground(Color.red);
    setHorizontalAlignment(RIGHT);
    } else {
    setForeground(Color.blue);
    setHorizontalAlignment(LEFT);
    return this;
    } // end class CustomRenderer
    Even worse, I've gotten this to work fine in a trivial example I made to try and re-create the problem. But for some reason, this same thing is just not working for horizontal alignment in my actual project?!?
    Anyone have any ideas how the cell's horizontal alignment set in the getTableCellRendererComponent() method is being ignored or overwritten before the cell is being displayed???
    Thanks, any help is appreciated,
    -Alex Blume

    Ok, so I've looked into their source and I think I know where and what the trouble is. The JTable.java has a method called:
    3658> public TableCellRenderer getCellRenderer(int row, int column) {
    3659> TableColumn tableColumn = getColumnModel().getColumn(column);
    3660> TableCellRenderer renderer = tableColumn.getCellRenderer();
    3661> if (renderer == null) {
    3662> renderer = getDefaultRenderer(getColumnClass(column));
    3663> }
    3664> return renderer;
    3665> }
    starting at line 3658 of their source code. It retrieves the TableCellRenderer on line 3660 by calling the tableColumn's getCellRenderer method. This is found in the TableColumn.java class:
    421> public TableCellRenderer getCellRenderer() {
    422> return cellRenderer;
    423> }
    See the problem? Only ONE cell Renderer. It's referring to a variable found at line 140 which is of type TableCellRenderer ... well actually it's created as a DefaultTableCellRenderer at some point since TableCellRenderer is an interface.
    Basically the fix is this:
    In the TableColumn.java file, a collection (Vector, LinkedList, whatever) needs to keep track of each cell's renderer. This will solve the solution. Of course this will be something that you or I can make.
    What's funny is the contradiction in documentation between JTable's and TableColumn's getCellRenderer() method. First, if we look at TableColumn's documentation it states:
    "Returns the TableCellRenderer used by the JTable to draw values for this column."
    Based on that first statement, the getCellRenderer() method in TableColumn is doing its job exactly. No lies, no contradictions in what it does.
    However, that method is called up inside of the JTable's getCellRenderer() method which says a completely different thing which is:
    "Returns an appropriate renderer for the cell specified by this row and column."
    Now we have a problem. For the cell specified. It appears that the rush to push this out blinded some developer who either:
    1) mis-interpreted what the JTable getCellRenderer() method was supposed to do and inadvertently added a feature or;
    2) was in a 2 a.m. blitz, wired on Pepsi and adrenalin and wrote the bug in.
    Either way, I'm really hoping that they'll fix this because it will take care of at least 2 bugs. Btw, anyone interested in posting a subclass to solve this problem (subclass of TableColumn) is more than welcome. I've spent much too much time on this and my project is already behind so I can't really afford any more time on this.
    later,
    a.

  • Can table cell vertical alignment be defined via CSS?

    In a table cell (ie, "td") is there a way to define "valign" via CSS, instead of the table cell proper?
    In other words, instead of...
    <table>
    <tr>
    <td valign="top">
    ...is it possible to do :
    <table>
    <tr>
    <td class="top">
    ...and somehow let the stylesheet define the vertical alignment?
    I'm asking because none of the attribute presets in Dreamweaver CS4 seem to provide for vertical alignment. Everything else on God's green earth seems to be there, but table cell vertical alignment seems to be the ONLY thing CSS forgot about.

    How about giving the class "top": text-align:center. Or even the tag "td" in your stylesheet. Does that help?
    John

  • Cell horizontal alignment

    Hi,
    does someone know how to set the horizontal alignment of a cell ???
    Thanks, Fred.

    A JTable object provides a TableCellRenderer object for each of its column. It usually takes it from the TableColumn object provided by its own TableColumnModel, if available, or otherwise provides a DefaultTableCellRenderer object. This default cell renderer is basically a JLabel formatted according to the type of value it has to display.
    You can write your own cell renderer, e.g. a JLabel that you format as you wish, and set it as the default cell renderer for the table using the setDefaultRenderer method.
    Or you can overwrite the getCellRenderer method of the table and have it return the appropriate cell renderer for a column.
    Or you can write your own TableColumnModel and have it used by the table.
    The chosen solution depends on what you really need to do. Hope it helps.

  • Table Cell Alignment

    Is it possible to establish default alignments for different cells in a table?  I have a table with 13 columns.  I would like to be able to set the default alignment to "center" in all columns but two.  I wish the second column to have a default alignment of "right" and the third column to have a default alignment of "left".  Then when I copy data from an excel spreadsheet into the table, I would like these alignments to be maintained.
    Thanks in advance for any help you can provide!
    Greg

    Gregory Kush wrote:
    Is it possible to establish default alignments for different cells in a table?  I have a table with 13 columns.  I would like to be able to set the default alignment to "center" in all columns but two.  I wish the second column to have a default alignment of "right" and the third column to have a default alignment of "left".  Then when I copy data from an excel spreadsheet into the table, I would like these alignments to be maintained.
    Thanks in advance for any help you can provide!
    Greg
    Can you do what you are asking easily, sure with CSS it's a fairly easy task.  Copying and pasting from Excel, this gets discussed very often and it's not a pretty process.  First because Excel does not Export HTML well at all, and XML exporting in Excel is not an easy task to set up, but once it's setup it can be a viable workflow.
    CSS Tutorial - http://www.w3schools.com/CSS/
    Basically you define a class or ID to your table and another class to text align left.  So you do something like this:
    CSS
    .center-text { text-align: center; }
    .left-text { text-align: left; }
    .right-text { text-align: right; }
    <table class="center-text"><tr><td> // that will center everything in the table.
    Then for the right align and left align just apply the respective class to the cell (this can also be done through properties window by using the drop-down menu to select the class).  If you are using XML or populating this information from a database can just run a loop to populate the data, and you can also use that same query to populate Excel for reporting if you wish to go that route.

  • Vertical alignment in table cells not working in generated output

    Using RH9 WebHelp. I have created a simple table style. Because I could not find out how to make cell vertical alignment (top, center, bottom)  part of the style definition, I have been applying it manually to individual whole tables using the cell alignment properties.
    This worked fine for a while, but at some point I noticed that even though the tables look right in Design view, with top-aligned cells contents, it gets hosed in generating output and all tables now come with vertically centred cell contents even through the in-line formatting for top alignment is still there in the code.
    Any ideas?

    Hi Mike,
    I'm confused to where you applied the vertical alignment. Normally, I would set this for the table cells and not the table.
    CSS has indeed an order in rendering: There is a point system for determining the CSS to apply. See http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-understanding-css-specific ity/ for a short introduction.
    And as an extra to the point system, the place where the styling is present, also determines the styling. Browsers use the following hierarchy (in descending order)
    User style sheet defined in the browser.
    Inline styling.
    Style block in page.
    External style sheet
    You can overwrite styling from a lower order using the !important declaration. You can use this to make sure that inline styling will not be able to overwrite styles from your style sheet. (Unless the inline styles use !important themselves.) Example:
    table.mytable td {
         vertical-align: middle !important;
    This will make all the content of table cells in the table with the class mytable to be vertically centered.
    Greet,
    Willam

Maybe you are looking for

  • Software update, and now I can't get Safari to open.

    I have a 15", late 2007 Macbook Pro. I'm running 10.6.8, and I believe the update was to Safari 5.1.1. Last month, the same thing happened. Luckily, I was staying near an Apple store. They had to reinstall the OS. I haven't tried that yet, because I

  • IE 5 and java2

    Can i use swing components in applets and watch it in ie5 without installing any "running environments" ?

  • Can we restrict the partially confirmed production order from getting delet

    Dear all, Can we restrict the partially confirmed production order from getting deleted? I.e. if the production order is having status PCNF then the deletion flag indicator (status DLFL) should not be allowed to set SmanS Edited by: SAP PP Consultant

  • Adobe form processing issue in portal

    Hi, We have one issue on user processing of adobe form in portal When user clicked on approve or reject button of HR position form its not completing. Its keep on processing till 3o minutes,i mean processing wheel not completing. What is reason for t

  • '?' On thumbnail

    In editor I made a photo book.  On the thumbnail view of the pages (in the bin on the right) there suddenly appeared a tiny ? In the upper left corner of a page layout.  What does this mean?