Adding Column structure to Div
Hi,
If I need to display data inside the #Log div using a column structure.
What would be the best : Table or Div tags.
By using a column structure it would change the dynamics of the program.
Searching looping thru the log div ... etc.
Can someone please help.

- <script>
-
- $("document").ready(function()
- {
-
- //Update Log div with selected items
- function log(message) {
- var matches = $('#log div').
- filter(function() { return $(this).text() == message; });
- if (matches.length == 0) {
- $('#log').append($('<div/>').text(message)).scrollTop(0);
- }
- }
- //Read searchphp and pupulate Search Autocomplete
- $( "#search" ).autocomplete(
- {
- source: "searchdb.php",
- minLength: 2,
- select: function( event, ui)
- {
- log( ui.item ?
-
- "<tr><td>" + ui.item.value + "</td><td>" + ui.item.Event + "</td></tr>"
- // "Event ID : " + ui.item.value + " Event Name : " + ui.item.Event :
- "Nothing selected, input was " + this.value );
- }
- });
- })
-
-
- $(function ()
- {
- // Function to read #log div
- function runupdate(personsIDval)
- {
- var events = [];
- var idRE = /^Event ID : (\d+).*$/;
- $('#log div').each(function ()
- {
- events.push(idRE.exec($(this).text())[1]);
- });
- // alert("Test Values - PersonsID : " + personsIDval + " EventsID : " + events );
-
- jQuery.get('runupd.php',
- {
- personsID: personsIDval,
- eventsID: events
- }, function (data) {
-
- alert(data);
- });
-
-
-
- }
- //Click button to run function - will loop thru the #log div
- $("input#runupdate2").click(function ()
- {
- $('#log div').each(function (i)
- {
- var text = $(this).text();
- // call and send variable to function
- var personsIDnr = '007'
- runupdate(personsIDnr);
- });
- });
- });
- </script>
- </head>
- <body>
- <div class="demo">
- <div class="ui-widget">
- <label for="search">Search Events: </label>
- <input type="text" id="search" value="">
- </div>
- <div class="ui-widget" style="margin-top:2em; font-family:Arial">
- Selected Events:
- <div id="log" style="height: 200px; width: 500px; overflow: auto;" class="ui-widget-content">
- <!-- <table width="200" border="1">
- <tr>
- <th>Event ID</th>
- <th>Event Name</th>
- </table>-->
- </div>
-
- </div>
- </div>