Recently I was tasked with incorporating results from the popular sailing race result scoring software SailWave into our club's site - The National Yacht Club. Here is the approach I took.
While SailWave supports exporting HTML that you can customize, there were a couple of problems:
- I didn't have access to the club's PC (SailWave is desktop software)
- In the event the club upgrades their version I wanted to make sure my changes wouldn't get broken.
So, instead I decided that the uploads should use the out-of-the-box styling, and I would overwrite with my own CSS rules. All I needed to do was access the resulting .htm file that had been uploaded.
Reading the File
I asked the race committee to upload their files using a convention based on the date: YYYYMMDD.htm. I pull the data in asynchronously using the jQuery load function on document load:
$(document).ready(function() {
$('#results').load('results/20090513.HTM #wrap');
});
The magic here is the '#wrap' part. This tells jQuery to filter the document that is being loaded based on an id. In this case, we only want the results table, which is conveniently exported inside a <div id="wrap"> tag by SailWave.
Styling the CSS
The standard HTML upload generates a semantically marked up HTML document. This makes it easy to style the results table to match your site colors. Here are the CSS rules for our site:
.hardleft {text-align: left; float: left; margin: 15px 0 0 25px;}
.hardright {text-align: right; float: right; margin: 15px 25px 0 0;}
table, caption {text-align: left; margin: auto; font-size: 1em; border-collapse: collapse; border: 1px #fff solid;}
table th {background-color: #d7d7c3;}
td, th, caption {padding: 4px; border: 2px #fff solid; vertical-align: top;}
caption {padding-left: 5px; text-align: center; border: 0; font-weight: bold;}
h1 {font-size: 1.5em; color: #9DA075;}
h2 {font-size: 1.4em;}
h3 {font-size: 1.2em;}
p {text-align: center;}
th, {background-color: #aaf;}
.contents {text-align: left; margin-left: 20%;}
.race, .rank {text-align: center;}
.even {background-color: #e1e8f0;}
.odd {background-color: #edece3;}
Pretty straightforward really.
You can see an example here.
If you would like help incorporating this into your club's site please feel free to contact me and I'd be glad to help out.
Posted by: Mike | 2009.12.29 at 10:26 AM
Posted by: Gavin | 2009.12.29 at 11:16 AM
Posted by: Ian | 2010.01.29 at 04:22 PM
Posted by: tableau condos | 2010.10.21 at 10:20 AM
Posted by: Colin Jenkins | 2011.09.07 at 06:02 PM
Posted by: New Mexico Service Jane | 2012.04.17 at 03:12 AM