Giter VIP home page Giter VIP logo

json-to-html-table's Issues

using the library

Hi,

I am trying to use the library in my code but doesn't display anything?

<title></title> <script type="text/javascript" src="jsontohtml.js"></script>
    <div> 
        <?php

       // echo $jsonResult;
          error_reporting(E_ALL);
         ini_set("display_errors", 1);
         include 'include/weather_data.php';
         include 'include/getJson.php';
        $jsonValue = new getjson();
        $table = 'WEATHER_SIMPLE_FORECAST';
         $jsonResult = $jsonValue->getJsonData($table);
        print_r($jsonResult);

        ?>

        <script type="text/javascript">
            var jsonHtmlTable = ConvertJsonToTable(eval([$jsonResult]), 'jsonTable', null, 'Download');
            document.write(jsonHtmlTable);
        </script>

   </div>
</body>

Could you please tell me what am i doing wrong?

Thanks

When a key's value is an object, this displays [object Object] in the table cell.

My JSON object looks like the following:

var myJSON = {

   key1 : val1
  ,key2 : val2
  ,key3 : {subkey1 : subval1, subkey2 : subval2, subkey3 : subval3}

}

When I run your function like so:

var disp = $('#DEBUG_AREA');
var jsonTable = ConvertJsonToTable(eval([myJSON]), "jsonData", null, 'Download');
disp.append(jsonTable);

For the key3 cell, I see [object Object]. I was expecting to see a nested table showing the structure of that particular sub-object. What parts of the code would be changed to allow for this feature?

Thanks!

please

you could be more specific in the readme

One strange request

Hi,

thanks for great lib I have used it for a while one.. and I stumbled upon change I would like to have..

I need to remove thead block from table completely so to have all in rows (tr) appended to tbody element...

I tried to alter lines 67, 70 where var th and thRow are to td and tbody but it somehow parsed wrong..

Do you have some idea how to go with that ?

thanks, krex

Having issues with Dates/Xmlgregoriancalendar values in table

All the date values in the cell , show null. i check the json string which has the following value
someDate":{"year":2012,"month":12,"day":17,"timezone":-360,"hour":0,"minute":0,"second":0,"fractionalSecond":0.000}

this value is shown as null in the table.

Nesting not working.

I only get the top level objects in the display results.
Nesting not working?

have problem with json objects

library works with jsonarrays but It does not work for me using json objects
jsonData={"x":1,"y":2,"z":3};
var jsonHtmlTable = ConvertJsonToTable(jsonData, 'jsonTable', null, 'Download');

Using the library in code

<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <script type="text/javascript" src="jsontohtml.js"></script>
    </head>
    <body>

        <div> 
            <?php

           // echo $jsonResult;
              error_reporting(E_ALL);
             ini_set("display_errors", 1);
             include 'include/weather_data.php';
             include 'include/getJson.php';
            $jsonValue = new getjson();
            $table = 'WEATHER_SIMPLE_FORECAST';
             $jsonResult = $jsonValue->getJsonData($table);
            print_r($jsonResult);

            ?>

            <script type="text/javascript">
                var jsonHtmlTable = ConvertJsonToTable(eval([$jsonResult]), 'jsonTable', null, 'Download');
                document.write(jsonHtmlTable);
            </script>

       </div>
    </body>
</html>

Could you please tell me why is it not displaying anything?

Thanks

Getting empty table in output for the simple JSON (DynamoDB query result)

I am trying JSON to html on the following JSON, and I am receiving empty table in the output. Any idea what I maybe missing here?

var jsonData = {"ConsumedCapacityUnits":0.5,"Item":{"FirstName":{"S":"Joe"},"LastName":{"S":"Smith"}}};
var htmlOutput = ConvertJsonToTable(jsonData); //Empty html table is returned here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.