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.

Similar Messages

  • 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

  • SAP Portal development-Table Controls having link to table cell content

    Hello all,
    I am creating the SAP portal in which i am using Table controls to display the data. I want the function should be called whenever user clicks the table cell content. i.e. i want to create the function link to table cell.
    Please reply soon.
    Regards,
    Prashant

    Hi Prashant,
    You haven't mentioned if you are using Webdynpro or HTMLB JSPDynPages.
    If its the webdynpro, you can declare then and there itself that the content to the table column is a row my changing the property.
    If it is a HTMLB component TableVIew that you are trying to use, you can include a TableCellRenderer Class which renders the cells of the table at the runtime as links or buttons or whatever you want to put.
    So let me know, what exactly you are trying to use, then finding a solution will be more clear.
    regards,
    Sujana

  • How to control background color of table cell in an html report?

    I am using Labview 6.1 to generate a report.  In that report there is a table created using the Append Numeric Table to Report VI.  I want to be able to programmatically control the background color of each cell in the table.  Also, how can I programmatically control the background color of the row and header cells of the same table.  I am also generating a second table in the same report using the Append Text Table to Report VI and I would like to programmatically control the background colors of the cells in that table as well.  Thanks.

    Hi epsilon-d...,
    i´m not sure if there is an ready to use function to do what you want, but you can enlarge the available function. Open the "Append Numeric Table to Report.vi" and go to the HTML Case. There you can see another vi which creates the html table. In the VI "HTML Report Table Row" you can add the option: bgcolor="your color" inside of the "TR" tag.
    Hope it helps.
    Mike

  • Does SSRS dynamically set the alignment of table cells based on the majority of cell types in the column???

    This is the first time I've run into this, but it appears that SSRS is setting the text-align based on the other cells in the column.  I have cells being set with either a dataset item of type System.Double or to "--" when Is Nothing evaluates
    to true.  I never noticed before that if the majority of the cells in the column are Nothing, then the few that aren't Nothing get aligned to the left along with all of the "--" text items.  And now I also see columns where the opposite
    is also happening, where if the majority of the cells in the column are numeric values, then everything is aligned right, even the few "--" items there.  I'm only using Default TextAlign and VerticalAlign, and no Indent, SpaceAfter or SpaceBefore,
    nor any concatenated text or embedded preserved spaces.
    Has anyone else in the SSRS universe seen this, and does anyone know why or have a good workaround for it?
    Thanks in advance : )

    Are you viewing the report in html format or are you looking in some other format like Excel,CSV etc?
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • 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.

  • 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.

  • 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>

  • 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

  • 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.

  • How to control the force return in table cell data?

    I have some xml format files.When I import them into FrameMaker,They display as table data.but when the data is very long in table cell,I want to control the new line by myself.for example,I add some \r\n in my xml file data,then in FrameMaker,It can identify the \r\n, force return.In framemaker I don't know the actual symbol that means the newline.How Can I deal with the problem?thank you!

    Hi Russ,
    yes, but you have to agree that forcing a return in the SOURCE content is really not a wise thing to do - It would be better to break the content into multiple paragraphs or used an XSLT to determine the column width and insert your own breaks in a version of the XML for rendering in Frame. If, at a later date, your templates in Frame change to allow wider columns in your table, then you'd have to go back into the source code and change every occurrence of the c/r in the data - Yeuch! Better to transform the data once, before importing into Frame and then if the col-width changes it is a simple task to change the width in the XSLT - personally, I would make sure the EDD and DTD allows multi-lines in the table cell and then break-up the data to fit the table cell size in an XSLT before importing. Then you don't taint your source code...and it is quite easy to do this is an XSLT...

  • Table cell formatting : please allow 'Horizontal autosizing' with 'at least' option like the vertical. Or is it in the pipeline already ?

    I suspect it has been asked by others, but can't find it in the archives. I need it for table cells with diagonals, and they need to fit like a glove.

    Hi,
    if the content is in a table cell (<td>), simply use valign="top" in the Region HTML table cell attributes.
    "Vertical align" is not intended to align text in a block, but an in-line component in another in-line component (for example a picture next to text).
    Maybe you have to play with margins.
    PS : more information here for example : http://evolt.org/article/rdf/17/60369/
    Yann.

  • Obi 10g, merge the table cells horizontally

    hi, experts,
    is it possible to merge the table cells horizontally?
    thank you very much!

    Forreging,
    Try removing left border of the cells using CSS/options in the coulmn properties.
    mark post promptly
    -bifacts
    http://www.obinotes.com
    J

  • 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 cells appear wider in Internet Explorer

    I've spent a long time creating a table-based website in DW
    and previewing it in safari and firefox. I've just uploaded it and
    tested on a PC and Internet Explorer is displaying the cells much
    wider than other browsers. This throws out the alignment of the
    whole site. Does anyone know why this is happening and how to force
    the cells to be a specific width? The width setting in the property
    inspector doesn't make any difference. thanks

    On Fri, 18 Jul 2008 13:31:30 +0000 (UTC), "drennan_uk"
    <[email protected]> wrote:
    >Thanks. I'm on a really tight deadline with this but if
    there's no quick fix
    >for the text field prob in IE, I guess i'll have to learn
    HTML/CSS properly.
    >If you could show me the optimized version Malcolm that
    would be a great help.
    >Thanks for your time.
    OK - here is even more stripped down code - but same visual
    effect,
    and it looks very similar in IE6,7 & FF & Safari
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=UTF-8">
    <title>products</title>
    <script type="text/javascript">
    function change(obj) {
    var tr=obj.parentNode.parentNode.parentNode; // this may
    change
    depending on the html used
    tr.style.backgroundColor=(obj.checked)? '#66CCFF' :
    '#B1AAD7';
    </script>
    <style type="text/css">
    body { background-color: #000000; font-family: Verdana,
    Arial,
    Helvetica, sans-serif;
    font-size: 9px; font-style:normal;}
    table {
    border-collapse: collapse;
    border-spacing: 0;
    border-color: #3399CC; } /* Not really necessary in this
    application */
    table th, tfoot td { background-color:#9000FF; } /* controls
    the
    purple background */
    tbody td { text-align:right; } /* controls display of main
    table
    values */
    tfoot input { text-align:right; font-size:1.3em; color:red;
    results display style */
    thead tr {height:3em;} /* controls height of top row */
    tr.color1 td {background-color:#D2CAEB;} /* controls
    background value
    of row */
    tr.color2 td {background-color:#B1AAD7;} /* controls
    background value
    of row */
    tr.topRow { background-color:white; } /* controls background
    value of
    toprow */
    tfoot td {text-align:center;} /* makes all content in td's
    centre
    unless overuled by .leftalign. th's are centred by default */
    .leftAlign { text-align:left; }
    </style>
    </head>
    <body>
    <form action="#">
    <table border="0" align="center" cellpadding="0"
    cellspacing="0">
    <thead>
    <tr>
    <th width="25"> </th>
    <th width="25"> </th>
    <th width="66" class="leftAlign" >Product</th>
    <th width="27"> </th>
    <th width="29">Add</th>
    <th width="55">Price</th>
    <th width="55">Energy</th>
    <th width="55">Protein</th>
    <th width="55">Carbs</th>
    <th width="55">Of Sugs</th>
    <th width="55">Fat</th>
    <th width="55">Of Sats</th>
    <th width="55">Fibre</th>
    <th> </th>
    </tr>
    </thead>
    <tbody>
    <tr class="topRow">
    <th> </th>
    <td> </td>
    <td>Product </td>
    <td>1</td>
    <td><label>
    <input type="checkbox" name="toggle" value="0.80"
    id="bread_brown7" onclick="change(this);">
    </label></td>
    <td>£0.60</td>
    <td>15 kcal</td>
    <td>54g</td>
    <td>10g</td>
    <td>20g</td>
    <td>30g</td>
    <td>40g</td>
    <td>50g</td>
    <th> </th>
    </tr>
    <tr class="color1">
    <th> </th>
    <td> </td>
    <td>Product </td>
    <td>2</td>
    <td><input name="bread_brown2" type="checkbox"
    onclick="clickCh()" value="0.80"
    id="bread_brown7"></td>
    <td>£0.15</td>
    <td>15 kcal</td>
    <td>54g</td>
    <td>10g</td>
    <td>20g</td>
    <td>30g</td>
    <td>40g</td>
    <td>50g</td>
    <th> </th>
    </tr>
    <tr class="color2" >
    <th> </th>
    <td> </td>
    <td>Product </td>
    <td>3</td>
    <td><input name="bread_brown2" type="checkbox"
    onclick="clickCh()" value="0.80"
    id="bread_brown11"></td>
    <td>£0.80</td>
    <td>15 kcal</td>
    <td>54g</td>
    <td>10g</td>
    <td>20g</td>
    <td>30g</td>
    <td>40g</td>
    <td>50g</td>
    <th> </th>
    </tr>
    <!-- more Item rows here -->
    </tbody>
    <tfoot>
    <tr>
    <td> </td>
    <td> </td>
    <td><strong>TOTALS</strong></td>
    <td> </td>
    <td> </td>
    <td><input name="total1" type="text" id="total1"
    value="0.00"
    size="5" readonly="readonly"></td>
    <td><input name="total2" type="text" id="total2"
    value="0"
    size="5" readonly="readonly" border="0"></td>
    <td><input name="total3" type="text" id="total3"
    value="0"
    size="5" readonly="readonly"></td>
    <td><input name="total4" type="text" id="total4"
    value="0"
    size="5" readonly="readonly"></td>
    <td><input name="total5" type="text" id="total5"
    value="0"
    size="5" readonly="readonly"></td>
    <td><input name="total6" type="text" disabled
    id="total6"
    value="0" size="5" readonly="readonly"></td>
    <td><input name="total7" type="text" id="total7"
    value="0"
    size="5" readonly="readonly"></td>
    <td><input name="total8" type="text" id="total8"
    value="0"
    size="5" readonly="readonly"></td>
    <td> </td>
    </tr>
    </tfoot>
    </table>
    </form>
    <script type="text/javascript">
    function clickCh(){
    var
    tr=document.getElementsByTagName('tbody')[0].getElementsByTagName('tr');
    var
    total1=total2=total3=total4=total5=total6=total7=total8=0;
    for(var i=0; i<tr.length; i++) {
    if(tr
    .getElementsByTagName('td')[4].getElementsByTagName('input')[0].checked)
    var td=tr.getElementsByTagName('td');
    total1+=parseFloat(td[5].firstChild.data.replace(/^[^\w\d\s\.\,]*/,""));
    total2+=parseInt(td[6].firstChild.data);
    total3+=parseInt(td[7].firstChild.data);
    total4+=parseInt(td[8].firstChild.data);
    total5+=parseInt(td[9].firstChild.data);
    total6+=parseInt(td[10].firstChild.data);
    total7+=parseInt(td[11].firstChild.data);
    total8+=parseInt(td[12].firstChild.data);
    document.getElementById('total1').value="£"+total1.toFixed(2);
    document.getElementById('total2').value=total2;
    document.getElementById('total3').value=total3+"g";
    document.getElementById('total4').value=total4+"g";
    document.getElementById('total5').value=total5+"g";
    document.getElementById('total6').value=total6+"g";
    document.getElementById('total7').value=total7+"g";
    document.getElementById('total8').value=total8+"g";
    </script>
    </body>
    </html>
    ~Malcolm~*...
    ~*

Maybe you are looking for

  • Sudden Media Card error..?

    Hello everyone. For the past few weeks, my media card in my BB 8900, which has been working fine before this suddenly started, has now been displaying the following error message whenever I unplug it from my wall-charger or my USB connection cord tha

  • Endless waiting for the windows support software to download

    absolutely uncomfortable speed when windows support software drivers downloading it seems to take a few days!!! ohhh, that expensive big data center... has anyone same problem?

  • Illustrator files crash Fireworks

    I just got started with Fireworks CS3, installed yesterday for the first time. I'm trying to open Illustrator files but Fireworks crashes every time. Installation went smoothly, I unistalled and reinstalled just to be sure. But, no luck, I can't open

  • Themes For Graphs and Charts??/

    On the apple website with iWork, it shows a bar graph that has marble on it and a wood one. How do I get those?

  • HT1349 i need to put the documents from the mac onto the mac book air

    i need to put the documents from the mac onto the mac book air.  How to I transfer my mac documents and music information to my macBook air?