Hybrid Posted May 20, 2006 Share Posted May 20, 2006 Hey guys,I was wondering about javascript! If I wanted to incorporate tables into my site would I add them in the script or would I add the scripts into the table! Also do many coders use the "document.write" to too actually write in their pages or they do not?Thank you for any help! Link to comment Share on other sites More sharing options...
scott100 Posted May 20, 2006 Share Posted May 20, 2006 If you give us an idea of what you are trying to achieve we can give you more accurate answers.Yes you can write tables to a page with javascript.Yes you can add scripts within or inline a table.I can't speak for many coders but i know some have had problems with document.write, where it has been writing to a new window and not the current one. Link to comment Share on other sites More sharing options...
Hybrid Posted May 20, 2006 Author Share Posted May 20, 2006 If you give us an idea of what you are trying to achieve we can give you more accurate answers.Yes you can write tables to a page with javascript.Yes you can add scripts within or inline a table.I can't speak for many coders but i know some have had problems with document.write, where it has been writing to a new window and not the current one.<{POST_SNAPBACK}> So "document.write" is not that popular from what you are saying. What I wanted to achieve with the tables is that I want to make a website that uses them. So that I can divide the page better, ex. I can make one for the banner at the top. Then one can be for a menu and so on, I have seen many website use them and I have heard they are popular to use nowadays!My question was if I could make tables in the javascript part example:<script type="text/javascript">PLACE TABLE CODE IN HERE!!!</script> Now would something like that be possible or would I have to make tables seperate from the javascript? Link to comment Share on other sites More sharing options...
scott100 Posted May 20, 2006 Share Posted May 20, 2006 So "document.write" is not that popular from what you are saying.I have had no problems with it, i know other people prefer to use DOMWhat I wanted to achieve with the tables is that I want to make a website that uses them. So that I can divide the page better, ex. I can make one for the banner at the top. Then one can be for a menu and so on, I have seen many website use themYes tables are still used but css is preferred for page layout these days, namely div's replace tables (you can use a combination of both though).I have heard they are popular to use nowadays!I would say the opposite, w3 recomends css as i said above and most people are converting their sites from tables to div'sNow would something like that be possible or would I have to make tables seperate from the javascript? That would be possible.Can i ask why you want to write tables to your page with javascript? (remember people can turn it off)Hope this covers everything Link to comment Share on other sites More sharing options...
Hybrid Posted May 20, 2006 Author Share Posted May 20, 2006 Actually now that you explained to me one thing I am thinking of not using tables lol! I alwasy wanted to know what DIV's were for!I remember that in te W3SCHOOLS tutorial you mentioned DIV in a table but never really explained them that well. I was also planning on using a css template!But I was wondering if you could mayeb explain to me how these DIV's work, are they like tables or something else?EDIT: Also I have never had any problems with Javascript either! Well so far so good I guess!EDIT 2: Sorry for editing twice but I wanted ot ask seeing as you mentioned DIV's. I noticed that some site incorpoarte the use of Tables with DIV's why is that and should you do that if you are using DIV? Link to comment Share on other sites More sharing options...
scott100 Posted May 20, 2006 Share Posted May 20, 2006 Here is a basic tables layout: http://www.w3.org/2002/03/csslayout-howtoHave a play around with the css values and get a feel for how it works. The <div> tag defines a division/section in a document. Link to comment Share on other sites More sharing options...
Hybrid Posted May 20, 2006 Author Share Posted May 20, 2006 Sorry I was away for a pretty long time. I checked the site out and I think I have a better understanding of DIV's now. Thanks a lot Scott for all your help! If I need anything else I will be sure to come here! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now