Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS output of Postgres Query

    I have a pg query that returns a table I need to separated the table into three parts. Each rows has three Parts basically
    [ col 1-8][col 9-22][col 23-28] , [col 1-8] has the same info for all rows I want to print this info as a header on the page [col 23-28] also has duplicate info in the rows as does [col 23-28] the next section to print is the second but I only need 1 instance of data. the last section is also the same multiple rows with duplicate data again I only need 1 instance of each of the data.
    I have entered my code and part of the data also I have attached my CSS code and Part of the DATAFILE In XML any help would be great. Thanks:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <style>
    table
    {
    border-collapse:collapse;
    }
    table, td, th
    {
    border:1px solid black;
    }
    td
    {
    text-align:center;
    }
    table
    {
    width:800px;
    }
    th
    {
    Height:3px;
    }
    table.stat th, table.stat td {
      font-size : 77%; }
    </style>
    </head>
    
    <body>
    <script>
    function owner()
    {
    var i=1;
    do
      {
    <div align="center">
    <td><b>UST Class A/B Operator Designation</b></td>
    
    <table class="stat">
    <tr><th>State Owner ID<th>Owner Name:<th>Contact<th>
    <tr><td>&c1<td>&c2<th>&c3<th>
    <tr><th>Address<th>City:<th>State:<th>Zip
    <tr><td>&c4<td>&c5<td>&c6<td>&c7
    </table> ;
    i++;
     }
    while (i=1)
    }
    </script>
    
    <br>
    <table class="stat">
    <TR><TH><TH colspan="5">Designated Operator
    
    
    <TR><th>Operator Name<TH>Operator Co<TH>Operator Address<TH>City<TH>State<th>Zip<TH>Operator Phone<TD>Fax<TD>E-Mail
    <TR><TD>&c9<TD>&c10<TD>&c11<TD>&c12<td>&c13<td>&c14<td>&c16<td>&c17
    </table>
    <table class="stat">
    <tr><th colspan="4">Operator Training
    <tr><th>Training Co<th>Certificate #<th>Training Date<th>AB Designation
    <tr><td>&c18<td>&c19<td>&c20<td>&c21
    </table><br>
    
    
    <table class="stat">
    <tr><th colspan="7">Facility Information
    <tr><th>Site ID<th>Site Name<th>Address<TH>City<TH>State<th>Zip<th>AB Operator Cert#
    <tr><td>&c22<td>&c23<td>&c24<td>&c25<td>&c26<td>&c27<td>&c19
    </table>
    
    <script>
    function owner()
    {
    var i=1;
    do
      {
    <table class="stat">
    <tr><td>Owner Name<td>&c2<th>
    <tr><th>
    <tr><th>Signature<th colspan="3">;
     i++;
     }
    while (i=1)
    }
    </script>
    
    </table>
    </div>
    </body>
    </html>
    [data example]
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE data [
    <!ELEMENT data (AB_data+)>
    <!ELEMENT AB_data (ownid,ownername,contact,ownaddress,owncity,ownstate,ownzip,ownphone,aboper,oaddress,ocity,ostate,oz ip,ophone,ocell,ofax,oemail,trainco,certno,trdate,abdes,siteid,sitename,address,city,state,zip)>
    <!ELEMENT ownid (#PCDATA)>
    <!ELEMENT ownername (#PCDATA)>
    <!ELEMENT contact (#PCDATA)>
    <!ELEMENT ownaddress (#PCDATA)>
    <!ELEMENT owncity (#PCDATA)>
    <!ELEMENT ownstate (#PCDATA)>
    <!ELEMENT ownzip (#PCDATA)>
    <!ELEMENT ownphone (#PCDATA)>
    <!ELEMENT aboper (#PCDATA)>
    <!ELEMENT oaddress (#PCDATA)>
    <!ELEMENT ocity (#PCDATA)>
    <!ELEMENT ostate (#PCDATA)>
    <!ELEMENT ozip (#PCDATA)>
    <!ELEMENT ophone (#PCDATA)>
    <!ELEMENT ocell (#PCDATA)>
    <!ELEMENT ofax (#PCDATA)>
    <!ELEMENT oemail (#PCDATA)>
    <!ELEMENT trainco (#PCDATA)>
    <!ELEMENT certno (#PCDATA)>
    <!ELEMENT trdate (#PCDATA)>
    <!ELEMENT abdes (#PCDATA)>
    <!ELEMENT siteid (#PCDATA)>
    <!ELEMENT sitename (#PCDATA)>
    <!ELEMENT address (#PCDATA)>
    <!ELEMENT city (#PCDATA)>
    <!ELEMENT state (#PCDATA)>
    <!ELEMENT zip (#PCDATA)>
    ]>
    <data>
    <AB_data>
    <ownid>DEG123</ownid>
    <ownername>Duggan Energy Group</ownername>
    <contact>Patrick Duggan</contact>
    <ownaddress>7600 E Caley Ave</ownaddress>
    <owncity>Centennial</owncity>
    <ownstate>CO</ownstate>
    <ownzip>80111</ownzip>
    <ownphone>3038357055</ownphone>
    <aboper>Patrick Duggan</aboper>
    <oaddress>7600 E Caley Ave</oaddress>
    <ocity>Centennial</ocity>
    <ostate>CO</ostate>
    <ozip>80111</ozip>
    <ophone>3038357055</ophone>
    <ocell>3038835789</ocell>
    <ofax>3033021806</ofax>
    <oemail>pat.duggan@dugganegroup.com</oemail>
    <trainco>Duggan Energy Group</trainco>
    <certno>CGRS</certno>
    <trdate>11417</trdate>
    <abdes>2009-09-10</abdes>
    <siteid>AB</siteid>
    <sitename>101-CO</sitename>
    <address>ABC C-Store</address>
    <city>1313 Mockingbird Lane</city>
    <state>Aurora</state>
    <zip>CO</zip>
    </AB_data>
    <AB_data>
    <ownid>DEG123</ownid>
    <ownername>Duggan Energy Group</ownername>
    <contact>Patrick Duggan</contact>
    <ownaddress>7600 E Caley Ave</ownaddress>
    <owncity>Centennial</owncity>
    <ownstate>CO</ownstate>
    <ownzip>80111</ownzip>
    <ownphone>3038357055</ownphone>
    <aboper>Patrick Duggan</aboper>
    <oaddress>7600 E Caley Ave</oaddress>
    <ocity>Centennial</ocity>
    <ostate>CO</ostate>
    <ozip>80111</ozip>
    <ophone>3038357055</ophone>
    <ocell>3038835789</ocell>
    <ofax>3033021806</ofax>
    <oemail>pat.duggan@dugganegroup.com</oemail>
    <trainco></trainco>
    <certno>CGRS</certno>
    <trdate>114180</trdate>
    <abdes>2009-09-10</abdes>
    <siteid>AB</siteid>
    <sitename>101-CO</sitename>
    <address>ABC C-Store</address>
    <city>1313 Mockingbird Lane</city>
    <state>Aurora</state>
    <zip>CO</zip>
    </AB_data>
    <AB_data>
    <ownid>DEG123</ownid>
    <ownername>Duggan Energy Group</ownername>
    <contact>Patrick Duggan</contact>
    <ownaddress>7600 E Caley Ave</ownaddress>
    <owncity>Centennial</owncity>
    <ownstate>CO</ownstate>
    <ownzip>80111</ownzip>
    <ownphone>3038357055</ownphone>
    <aboper>Patrick Duggan</aboper>
    <oaddress>7600 E Caley Ave</oaddress>
    <ocity>Centennial</ocity>
    <ostate>CO</ostate>
    <ozip>80111</ozip>
    <ophone>3038357055</ophone>
    <ocell>3038835789</ocell>
    <ofax>3033021806</ofax>
    <oemail>pat.duggan@dugganegroup.com</oemail>
    <trainco>Duggan Energy Group</trainco>
    <certno>CGRS</certno>
    <trdate>11417</trdate>
    <abdes>2009-09-10</abdes>
    <siteid>AB</siteid>
    <sitename>102-CA</sitename>
    <address>ABC C-Store</address>
    <city>1234 Main St</city>
    <state>San Diego</state>
    <zip>CA</zip>
    </AB_data>
    <AB_data>
    <ownid>DEG123</ownid>
    <ownername>Duggan Energy Group</ownername>
    <contact>Patrick Duggan</contact>
    <ownaddress>7600 E Caley Ave</ownaddress>
    <owncity>Centennial</owncity>
    <ownstate>CO</ownstate>
    <ownzip>80111</ownzip>
    <ownphone>3038357055</ownphone>
    <aboper>Patrick Duggan</aboper>
    <oaddress>7600 E Caley Ave</oaddress>
    <ocity>Centennial</ocity>
    <ostate>CO</ostate>
    <ozip>80111</ozip>
    <ophone>3038357055</ophone>
    <ocell>3038835789</ocell>
    <ofax>3033021806</ofax>
    <oemail>pat.duggan@dugganegroup.com</oemail>
    <trainco></trainco>
    <certno>CGRS</certno>
    <trdate>114180</trdate>
    <abdes>2009-09-10</abdes>
    <siteid>AB</siteid>
    <sitename>102-CA</sitename>
    <address>ABC C-Store</address>
    <city>1234 Main St</city>
    <state>San Diego</state>
    <zip>CA</zip>
    </AB_data>
    <AB_data>
    <ownid>DEG123</ownid>
    <ownername>Duggan Energy Group</ownername>
    <contact>Patrick Duggan</contact>
    <ownaddress>7600 E Caley Ave</ownaddress>
    <owncity>Centennial</owncity>
    <ownstate>CO</ownstate>
    <ownzip>80111</ownzip>
    <ownphone>3038357055</ownphone>
    <aboper>Patrick Duggan</aboper>
    <oaddress>7600 E Caley Ave</oaddress>
    <ocity>Centennial</ocity>
    <ostate>CO</ostate>
    <ozip>80111</ozip>
    <ophone>3038357055</ophone>
    <ocell>3038835789</ocell>
    <ofax>3033021806</ofax>
    <oemail>pat.duggan@dugganegroup.com</oemail>
    <trainco>Duggan Energy Group</trainco>
    <certno>CGRS</certno>
    <trdate>11417</trdate>
    <abdes>2009-09-10</abdes>
    <siteid>AB</siteid>
    <sitename>104-WY</sitename>
    <address>Kwiky Mart</address>
    <city>1234 Frontier St</city>
    <state>Cheyenne</state>
    <zip>WY</zip>
    [/data]
    Attached Files Attached Files

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,763
    Thanks
    23
    Thanked 548 Times in 547 Posts
    Before preceding please fix this for me:
    Code:
    <script>
    function owner()
    {
    var i=1;
    do
      {
    
     i++;
     }
    while (i=1)
    }
    </script>
    <table class="stat">
    <tr><td>Owner Name<td>&c2<th>
    <tr><th>
    <tr><th>Signature<th colspan="3">;
    </table>-->
    
    <!--</div>
    </body>
    </html>
    Part of your table is in a javascript segment.

    And 1 question. Do you want the three parts of your table to show everything or do you want the table to be filled-in and another table for the next <AB_data> information.

    Oh and FYI the xml file ends like this:
    Code:
    <address>ABC C-Store</address>
    <city>1313 Mockingbird Lane</city>
    <state>Aurora</state>
    <zip>CO</zip>
    </AB_data>
    Clearly the city, state, zip not in right place (zip not there at all).

  • #3
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    css pg output

    Thank for responding. I had an error in my query when I converted to XML I have attached a correct file.

    Basically I have 1 Owner Separate table

    Two AB Operators Separate table

    and 7 sites. separate table

    the file contains 14 rows. 2 for each site based on the two AB Ops assigned to site

    14 owner info

    7 + 7 AB Op info
    and 7 + 2 of each site info
    Attached Files Attached Files

  • #4
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I just wrote a macro to handle the different output. Thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •