Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display a table with Javascript???

Status
Not open for further replies.

JPaulB

Programmer
May 26, 2005
2
0
0
CA
Hi Folks,

I want to make a function that will display a table. However, I seem to make a lot of mistakes with the syntax... at least the Table certainly doesn't display.
Is this function call correct?
<script type="text/javascript">
ShowTime(A,B,C,D,E,F)
</script>

How about the function itself?
function ShowTime(A,B,C,D,E,F)
{

}

How can I properly format the following <TABLE> as a javascript function?
Syntax like document.write("<TABLE BORDER=2><TR><TD>") doesn't appear to be enough, even though the border should appear

Thanks,
-Paul-
 
Show the code you have already, and then we can see why it's not working the way you want.

Lee
 
I think it also depends on whether you want to dynamically create the table or if you're just concerned about when a table might be displayed.

If you want to simply build a table dynamically, your best bet is to build the table using the DOM.
var table=document.createElement("table");
var tbody=document.createElement("tbody");
...etc.

If you simply want tables to appear and disappear, you should simply invoke the display style property of the table.

As mentioned by Trollacious, code would be helpful.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top