Hi all,

Can someone please help... I have a small youth football web site and would like to display the league table on a web page.

What is the best way to display this information, so that it is not to manual when i come to update the results weekly.

I have been using tables so far and then manually updating... WOW! this takes time.

Is there any way to just use excel to populate the data on the web page with out effecting the formatting.

your help would be very muh appreciated.

TiZo

Well you would go on google and type in how to make a data table online and some results would come up and you can pick which one you want to do. hope i could help.
SNIP

You can also (if you, or someone you know, know ASP.Net programming at all) utilize this method to read from your .xls file and use the data obtained to populate various ASP dynamic control types (gridview, etc) with the information or even use ASP Labels to populate the information in the same table you're already using.

Hope this helps :) Please mark as solved if your issue is resolved.

Ok, couldn't find or figure out any code for this - but tried a different route that is a good compromise.

I downloaded OpenOffice (free YAY) and then opened an Excel file in that. I saved a copy of the Excel file in an Open Document Format (so I wouldn't risk any data if it didn't work). Once opened, you can save as an HTML document. The code is SO much cleaner than Microsoft's - I could actually find the HTML tags without using the find feature.

Afterwards, I used file>open to open the html file. It allows you to edit the HTML file as a WSYWIG to fine tune anything. If you want to edit the HTML you can use View >HTML Source and toggle the option on and off - if you choose this way then you can take out the formatting and assign a style from a css stylesheet.

Another nice thing... for me at least... is the code gives you the date the content was created so you know when you made it and can double check if it is the most current.

That's the best I could find, but it is a hell of a lot easier than dealing with Microsoft's "export HTML" ::shudders::

Ok, came up with this - it isn't perfect but can definitely be modified to be a better fit for your site.

It is based off of using a .csv file exported from excel (this one has it in the same directory to make it easier for me to test over and over again). You have to click on the button for the output - again, just for me to test and check if things were working.

Here is a link to the posted code.

The code itself is below.

if (window.XMLHttpRequest) {
		//for firefox, opera and safari browswers
		var txtFile = new XMLHttpRequest();
	}
	if (typeof XMLHttpRequest == "undefined")
  XMLHttpRequest = function () {
    try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); }
      catch (e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); }
      catch (e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP"); }
      catch (e) {}
    //Microsoft.XMLHTTP points to Msxml2.XMLHTTP.3.0 and is redundant
    throw new Error("This browser does not support XMLHttpRequest.");
  };



allText = txtFile.responseText;

txtFile.open("GET","testingOne2.csv");
txtFile.send(false);




function clickyHere(){
	var allText = txtFile.responseText;
	var tableTesting = [];
	var tableTesting = allText.replace(/\n|\n^|^/g,"<tr><td>").replace(/\s+,|,|,+\s/g,"</td><td>").replace(/^\r|\r/g,"</td></tr>");
	document.write("<table border='1'>");
	document.write(tableTesting);
	document.write("</table>");
}

Hope this helps and no, I didn't test it in IE.

Attached is the .csv file resaved as a .txt (tab delimited) that can be viewed (or saved and resaved as a .csv file for testing.)

commented: Dude better appreciate all that work :twisted: You rock! +1

Many thanks for looking into this, i will be revamping the web page shortly, so i will let you know how it goes
*************************************************************************************

Ok, came up with this - it isn't perfect but can definitely be modified to be a better fit for your site.

It is based off of using a .csv file exported from excel (this one has it in the same directory to make it easier for me to test over and over again). You have to click on the button for the output - again, just for me to test and check if things were working.

Here is a link to the posted code.

The code itself is below.

if (window.XMLHttpRequest) {
		//for firefox, opera and safari browswers
		var txtFile = new XMLHttpRequest();
	}
	if (typeof XMLHttpRequest == "undefined")
  XMLHttpRequest = function () {
    try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); }
      catch (e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); }
      catch (e) {}
    try { return new ActiveXObject("Msxml2.XMLHTTP"); }
      catch (e) {}
    //Microsoft.XMLHTTP points to Msxml2.XMLHTTP.3.0 and is redundant
    throw new Error("This browser does not support XMLHttpRequest.");
  };



allText = txtFile.responseText;

txtFile.open("GET","testingOne2.csv");
txtFile.send(false);




function clickyHere(){
	var allText = txtFile.responseText;
	var tableTesting = [];
	var tableTesting = allText.replace(/\n|\n^|^/g,"<tr><td>").replace(/\s+,|,|,+\s/g,"</td><td>").replace(/^\r|\r/g,"</td></tr>");
	document.write("<table border='1'>");
	document.write(tableTesting);
	document.write("</table>");
}

Hope this helps and no, I didn't test it in IE.

Attached is the .csv file resaved as a .txt (tab delimited) that can be viewed (or saved and resaved as a .csv file for testing.)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.