I am trying to create a datatable next to my globe like this one. I was able to create the table using jQuery datatable. However, it's creating the table in a div instead of in a span next to my globe. Screenshot below: I want to achieve an effect somewhat like this: I believe I have to use the span tag. #currentInfo is the div that the globe is in). I tried
$("#currentInfo").append("<span id='createSpan'></span>");
$("#createSpan").append("<table id='example' class='display compact' width='50%'></table>");
Nothing seems to change. The table is created as a div above the globe. So I tried:
$("#currentInfo").append("<span><table id='example' class='display compact' width='50%'></table></span>");
The result is still the same. The data returned is <div><span>data</span><span>data</span>.....</div>
The below code skips including the table completely.
$("#currentInfo").append("<span id='example' class='display compact' width='50%'></span>");
and I am also getting an error: DataTables warning: Non-table node initialisation (SPAN). For more information about this error, please see http://datatables.net/tn/2. This leads me to believe that jQuery datatable has to be appended in the format below with the table tag, and a div will be created and wrap around the data automatically.
$("#elementId").append("<table id='example' class='display compact' width='50%'></table>");
I am able to add span text by doing
$("#currentInfo").append("<span id='temp'>Add span text here</span>");
to the globe. I could style my data and just append it as a span, but there are so many read to use perks that come with the jQuery datatable (sort, format, etc.)
Is there a way that I can override the jQuery datatable div property, so it creates wrap the table in a span tag instead of a div? Or can anymore suggest a different data library that allows me to achieve this?
absolute
position would be the right way to solve this problem. I am pretty sure the sphere has some absolute styling as well. – davidkonrad