embed excel or .csv in webpage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • charles07
    New Member
    • Dec 2011
    • 45

    embed excel or .csv in webpage

    hi all

    is there anyway embedding excel or .csv files to the webpage other than the folowing two options

    . saving it as a webpage
    . using google docs

    i used the following code, iam getting the .csv file in the page, but it would be good to have the color formatting, bold, italics... also in the webpage.

    is it possible?

    Code:
    <?php 
          $cnx = fopen("example.csv", "r"); //open example.csv 
          echo("<table style='border:1px solid #ddd;'>"); // echo the table 
          while (!feof ($cnx)) { // while not end of file 
          $buffer = fgets($cnx); // get contents of file (name) as variable 
          $values = explode(",", $buffer); //explode "," between the values within the  contents 
          echo "<tr>"; 
          for ( $j = 0; $j < count($values); $j++ ) {  // 
          echo("<td style='border:1px solid #ddd;'>$values[$j]</td>"); 
          } 
          echo"</tr>"; 
          }; 
          echo("</table>"); 
          fclose($cnx); //close filename variable 
          ?>
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    if you want to create, read or update excel file then PHPExcel is a good choice

    Comment

    • charles07
      New Member
      • Dec 2011
      • 45

      #3
      i got one



      i tried PHPExcel too, but found too difficult to implement

      Comment

      • johny10151981
        Top Contributor
        • Jan 2010
        • 1059

        #4
        try again, if I can then even a cat can do that

        Comment

        Working...