The randomizing algorithm of javascript isn't perfect, but with a large enough sample like you have it's pretty good. Some browsers will do a better job than others. On any given day one browser may seem better than another, and on any given occasion a given browser may seem to be doing a better job than on others. Random means random though, so technically speaking one could get the same result many times in a row.
The handiest alternative for the web would be PHP if available on the server. I just worked this out, if you were to give the page a .php extension:
picton-bed-breakfast.php
You could get rid of javascript entirely and rewrite the table like so:
PHP Code:
<table summary="B&B summary">
<caption>Picton & Marlborough Sounds B&B</caption>
<thead>
<tr>
<th scope="col">B&B</th>
<th scope="col">Location</th>
<th scope="col">Price<br />from</th>
<th scope="col">Rooms</th>
<th scope="col">Bathroom</th>
<th scope="col">Dinner<br />available</th>
<th scope="col">Credit Card</th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="row"> </th>
<td colspan="6"> </td>
</tr>
</tfoot>
<tbody>
<?php
$bnbrows = array(
'<tr class="group1">
<th><a href="anchordown.html">Anchor Down</a></th>
<td>Picton</td>
<td>$110</td>
<td>2Q 1T</td>
<td>ensuite</td>
<td>Yes</td>
<td>No</td>
<tr>',
'<tr class="group1">
<th scope="row"><a href="cnocnalear.html">Cnoc na Lear Guest House</a></th>
<td>Endeavour Inlet</td>
<td>$180</td>
<td>1K/T, 1Q</td>
<td>ensuite</td>
<td>Yes</td>
<td>Yes</td>
<tr>',
'<tr class="group1 odd">
<th scope="row"><a href="echo-lodge.html">Echo Lodge</a></th>
<td>Picton</td>
<td>$100</td>
<td>2Q 1T 1S</td>
<td>ensuite</td>
<td>No</td>
<td>No</td>
<tr>',
'<tr class="group1">
<th scope="row"><a href="essons-valley.html">Essons Valley</a></th>
<td>Picton</td>
<td>$100</td>
<td>1D, 1 cabin </td>
<td>private</td>
<td>Yes</td>
<td>Yes</td>
<tr>',
'<tr class="group1 odd">
<th scope="row"><a href="fernview.html">Fernview Cottage</a></th>
<td>Picton</td>
<td>$140</td>
<td>1K,1Q,1T</td>
<td>private</td>
<td>No</td>
<td>No</td>
<tr>',
'<tr class="group1">
<th scope="row"><a href="glengary.html">Glengary</a></th>
<td><a >Picton</a></td>
<td>$80</td>
<td>2Q 1KT</td>
<td>ensuite</td>
<td>No</td>
<td>No</td>
<tr>',
'<tr class="group1 odd">
<th scope="row"><a href="grandvue.html">Grandvue</a></th>
<td><a >Picton</a></td>
<td>$75</td>
<td>1D 1Q/T</td>
<td>ensuite/share</td>
<td>No</td>
<td>V, M</td>
<tr>',
'<tr class="group1">
<th scope="row"><a href="koromiko-homestead.html">Koromiko Homestead</a></th>
<td><a >Koromiko</a></td>
<td>$200</td>
<td>2Q</td>
<td>private</td>
<td>No</td>
<td>V, M</td>
<tr>',
'<tr class="group1 odd">
<th scope="row"><a href="marineland-house.html">Marineland Heritage</a></th>
<td><a >Picton</a></td>
<td>$85</td>
<td>3T,5D,1S<br />1Q,1SK.</td>
<td>ensuite/private</td>
<td>No</td>
<td>All</td>
<tr>',
'<tr class="group1">
<th scope="row"><a href="mccormickhouse.html">McCormick House</a></th>
<td>Picton</td>
<td>$320</td>
<td>1Q,1KT,1T</td>
<td>ensuite</td>
<td>No</td>
<td>V A M D</td>
<tr>',
'<tr class="group1 odd">
<th scope="row"><a href="michiru.html">Michiru</a></th>
<td>Waikawa</td>
<td>$90</td>
<td>1D,1T,1S </td>
<td>1 ensuite<br />2 private</td>
<td>Yes</td>
<td>Yes</td>
<tr>',
'<tr class="group1">
<th scope="row"><a href="ramona.html">Ramona</a></th>
<td>Pelorus Sound</td>
<td>$90</td>
<td>1Q 1T</td>
<td>private</td>
<td>Yes</td>
<td>V, M</td>
<tr>',
'<tr class="group1 odd">
<th scope="row"><a href="retreat-inn.html">Retreat Inn</a></th>
<td>Picton</td>
<td>$135</td>
<td>1Q,1Q or T</td>
<td>ensuite/private</td>
<td>No</td>
<td>No</td>
<tr>',
'<tr class="group1">
<th scope="row"><a href="the-gables.html" title="The Gables">The Gables</a></th>
<td><a >Picton</a></td>
<td>$130</td>
<td>2Q 1D 2T</td>
<td>ensuite</td>
<td>No</td>
<td>V M EF</td><tr>',
'<tr class="group1">
<th scope="row"><a href="waterfront.html" title="Waterfront">Waterfront</a></th>
<td>Picton</td>
<td>$165</td>
<td>2Q</td>
<td>ensuite/private</td>
<td>Yes</td>
<td>No</td>
<tr>');
shuffle($bnbrows);
foreach ($bnbrows as $bnbrow) {
echo $bnbrow;
}
?>
</tbody>
</table>
The advantages are that there are no browser differences, the PHP randomizing function is more nearly truly random, generally faster, and you're not relying upon the user having javascript enabled. Of course, as I say the server must be PHP enabled though.
BTW, regardless of whether or not this is done via javascript, PHP, or any other method, you could give a class name (like odd) to alternating rows.
Bookmarks