1.11M Members

Table of data

 
0
 

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

 
0
 

well if you're just using html table to display the data, then you have to it that way. Enter datas manually.

If you want some automation you could explore doing it using PHP and excel.

check out this link:> http://www.ibm.com/developerworks/opensource/library/os-phpexcel/

 
0
 

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

 
0
 

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.

 
0
 

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::

 
1
 

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.)

Attachments testingOne2.txt (7.38KB)
 
0
 

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.)

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: