The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Adding HTML code to php file, Excel file converted to html needs to be added on website run on php (
lelos1
post Apr 10 2017, 09:23 AM
Post #1





Group: Members
Posts: 2
Joined: 4-September 16
Member No.: 24,809



Hi everyone! I recently got access to manage a website and i need to add an excel list. I just know very basic stuff and I am very unsure on how to do it... Any tips on how to do it would be very welcome!

I went to Microsoft excel and saved it as html. It saved 5 files and one of the html sheets has this code like this :

<html xmlns:v="urn:schemas-microsoft-com:vml"

xmlns:o="urn:schemas-microsoft-com:office:office"

xmlns:x="urn:schemas-microsoft-com:office:excel"

xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta http-equiv=Content-Type content="text/html; charset=windows-1252">

<meta name=ProgId content=Excel.Sheet>

<meta name=Generator content="Microsoft Excel 15">

<link id=Main-File rel=Main-File

href="../Alphabetical%20Member%20list%20HAAR%202017.htm">

<link rel=File-List href=filelist.xml>

<link rel=Stylesheet href=stylesheet.css>

<style>

<!--table

{mso-displayed-decimal-separator:"\.";

mso-displayed-thousand-separator:"\,";}

@page

{margin:.75in .7in .75in .7in;

mso-header-margin:.3in;

mso-footer-margin:.3in;}

-->

</style>

<![if !supportTabStrip]><script language="JavaScript">

<!--

function fnUpdateTabs()

{

if (parent.window.g_iIEVer>=4) {

if (parent.document.readyState=="complete"

&& parent.frames['frTabs'].document.readyState=="complete")

parent.fnSetActiveSheet(0);

else

window.setTimeout("fnUpdateTabs();",150);

}

}

if (window.name!="frSheet")

window.location.replace("../Alphabetical%20Member%20list%20HAAR%202017.htm");

else

fnUpdateTabs();

//-->

</script>

<![endif]>

</head>

<body link=blue vlink=purple>


<table border=0 cellpadding=0 cellspacing=0 width=1264 style='border-collapse:

collapse;table-layout:fixed;width:949pt'>

<col width=154 style='mso-width-source:userset;mso-width-alt:5632;width:116pt'>

---------------------------------------------------------------------



and the file I need to add this 'code' to is exactly like this :



---------------------------------------------------------------------

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>HAAR :: Hellenic Association for Aerosol Research</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<link rel="icon" href="favicon.ico"/>

<link rel="stylesheet" type="text/css" href="haar.css" />

<script type="text/javascript" src="haar.js"></script>

<?php

$doc = new DOMDocument;

$doc->preserveWhiteSpace = false;

$doc->Load('bgs.xml');

$theBGs = $doc->documentElement->childNodes->length - 1;

$randomBGnum = rand(0,$theBGs);

$randomBG = $doc->documentElement->childNodes->item($randomBGnum)->getAttribute("name");

echo "<style type='text/css'><!-- body { background-image:url(images/" . $randomBG . ".jpg);

background-attachment:fixed; background-position:top right; background-repeat:repeat; } --></style>";

if ($_GET["howMany"] == "") $howMany = 5; else $howMany = $_GET["howMany"];

if ($_GET["l"] == "") $lang = "gr"; else $lang = $_GET["l"];

?>

</head>

<body>

<div id="logo"><img src="images/logo1.png" border="0" alt="HAAR logo"/></div>

<div id="lang"><a href="?l=gr" class="menu">ελ</a> | <a href="?l=en" class="menu">en</a></div>

<div id="menu">

<a class="menu" href="index.php?l=<?php echo $lang; ?>"><?php if ($lang == "gr") echo "σχετικά";

else echo "about"; ?></a> |

<a class="menu" href="news.php?l=<?php echo $lang; ?>"><?php if ($lang == "gr") echo

"νέα/δραστηριότητες"; else echo "news/activities"; ?></a> |

<a class="menu" href="links.php?l=<?php echo $lang; ?>"><?php if ($lang == "gr") echo

"σύνδεσμοι"; else echo "links"; ?></a> |

<a class="menu" href="contact.php?l=<?php echo $lang; ?>"><?php if ($lang == "gr") echo

"επικοινωνία"; else echo "contact"; ?></a> |

<a class="menu" href="eac.php?l=<?php echo $lang; ?>">_eac_</a> |

<a class="menuActive" href="#"><?php if ($lang == "gr") echo "Μέλη"; else echo "Members"; ?></a>

</div>

<div id="viewer">

<?php

$content = new DOMDocument;

$content->preserveWhiteSpace = false;

$content->Load('contact.xml');

?>

<div class="title"><?php if ($lang == "gr") echo "Κατάλογος Μελών"; else echo "Members list";

?></div><br/>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 10 2017, 10:00 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



You should add just the table part where you want it to be in the existing HTML. But the the page from Excel is full off Office junk code and need to be cleaned up before you use it. You'd also need to add your own styling for the table.

Basically take everything from <table> to </table> but remove all attributes and stuff, just a clean table. Paste it where you want it and see how it looks. Then style it to fit with your page. We can help you with that, but you need to remove the junk first.

Instead of this....
CODE
<table border=0 cellpadding=0 cellspacing=0 width=1264 style='border-collapse:

collapse;table-layout:fixed;width:949pt'>

<col width=154 style='mso-width-source:userset;mso-width-alt:5632;width:116pt'>


Use this.
CODE
<table>
<col>


And so on. You probably can lose COL altogether, but keep it for now to make things easier for you. Keep tags, clean off attributes and values. And of course keep the content of the cells also! happy.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th March 2024 - 02:03 AM