Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-10-2013, 02:13 AM   PM User | #1
mtnbkr777
New to the CF scene

 
Join Date: Feb 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
mtnbkr777 is an unknown quantity at this point
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
File Type: txt AB OP Report Script.txt (1.6 KB, 10 views)
File Type: txt pg datafile.txt (12.9 KB, 7 views)
mtnbkr777 is offline   Reply With Quote
Old 02-10-2013, 04:43 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,391
Thanks: 18
Thanked 351 Times in 350 Posts
sunfighter is on a distinguished road
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).
sunfighter is offline   Reply With Quote
Old 02-10-2013, 08:09 PM   PM User | #3
mtnbkr777
New to the CF scene

 
Join Date: Feb 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
mtnbkr777 is an unknown quantity at this point
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
File Type: txt AB Report-2.txt (13.3 KB, 6 views)
mtnbkr777 is offline   Reply With Quote
Old 02-15-2013, 10:22 PM   PM User | #4
mtnbkr777
New to the CF scene

 
Join Date: Feb 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
mtnbkr777 is an unknown quantity at this point
I just wrote a macro to handle the different output. Thanks
mtnbkr777 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:06 PM.


Advertisement
Log in to turn off these ads.