Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,191 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,251 people online right now. Registration is fast and FREE... Join Now!




need help with table format

 
Reply to this topicStart new topic

need help with table format

ladiesman
post 18 Sep, 2008 - 10:09 PM
Post #1


New D.I.C Head

*
Joined: 9 Feb, 2008
Posts: 33

its correct i just want to know how to get it to show as
name: kieran
age:20
i keep getting it as
name:kieran age:20

CODE

<html>
<header></header>
<title></title>
<body>
<script type="text/javascript">
document.write("Hey work with me");
var name = prompt("What is your name?", "");
var age = prompt("what is your age?","");
var nationality = prompt("what is your nationality?","");
var street = prompt("what is your street address?","");
var city = prompt("what city are you from?","");
var town = prompt(" what town are you from?","");
var village = prompt("what village are you from?","");
var district = prompt("what district are you from?","");
var phone = prompt("what is your phone number?","");

document.write("<table border=6>");
document.write("<td>");
document.write("Name:");
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write(name);
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write("Age:");
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write(age);
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write("Nationality:");
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write(nationality);
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write("Street:");
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write(street);
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write("City:");
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write(city);
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write("Town:");
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write(town);
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write("Village:");
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write(village);
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write("District:");
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write(district);
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write("Phone:");
document.write("</td>");

document.write("<br>");

document.write("<td>");
document.write(phone);
document.write("</td>");
</script>
</body>
</html>
User is offlineProfile CardPM

Go to the top of the page

xerxes333
post 19 Sep, 2008 - 05:12 AM
Post #2


D.I.C Head

Group Icon
Joined: 5 Jul, 2007
Posts: 146



Thanked 7 times

Dream Kudos: 25
My Contributions


There are better methods for implementing the code you posted. But in keeping with your programming style, here is a partial solution. If you are interested in learning a more efficient method to accomplish the same goals I'd be happy to help you through it.

CODE

<html>
<header></header>
<title></title>
<body>
<script type="text/javascript">
document.write("Hey work with me");
var name = prompt("What is your name?", "");
var age = prompt("what is your age?","");
var nationality = prompt("what is your nationality?","");
var street = prompt("what is your street address?","");
var city = prompt("what city are you from?","");
var town = prompt(" what town are you from?","");
var village = prompt("what village are you from?","");
var district = prompt("what district are you from?","");
var phone = prompt("what is your phone number?","");

document.write("<table border=6>");

// Row 1
// For each row we need a opening and closing TR tag
document.write("<tr>");
    document.write("<td>");
        document.write("Name:");
    document.write("</td>");
    document.write("<td>");
        document.write(name);
    document.write("</td>");
document.write("</tr>");

//The BR tag is unnecessary when using a table layout

// Row 2
document.write("<tr>");
    document.write("<td>");
        document.write("Age:");
    document.write("</td>");
    document.write("<td>");
        document.write(age);
    document.write("</td>");
document.write("</tr>");

//Rest of the code . . . . .

</script>
</body>
</html>

User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/21/08 04:39PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month