Latest news from Xavier Media
It is currently Sun Dec 08, 2013 12:24 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: I need to put this is a table!
PostPosted: Tue Jun 22, 2010 6:10 pm 
Offline
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Tue Jun 22, 2010 3:18 am
Posts: 5
Points: 0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>Teas of the World!</title>
</head>
<body>
<?php // Script 10.6 - Teas of the World.php

// Address error handling.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);


function maketea($type = "Tea")
{
return "Making a cup of $type.\n";
}
echo maketea("Chinese Fruit Tea");

echo maketea("Mexican White Tea");

echo maketea("Japanese Green Tea");
?>

</body>
</html>


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
 Post subject: Re: I need to put this is a table!
PostPosted: Wed Jun 23, 2010 1:07 pm 
Offline
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Mon Jun 21, 2010 8:16 pm
Posts: 5
Points: 0
I don't quite get which part you need to put in table and which kind of table? you mean html or mysql?

_________________
helloooh, yoh.... ohhh?! :)


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
 Post subject: Re: I need to put this in the form of a function, help!
PostPosted: Wed Jun 23, 2010 10:29 pm 
Offline
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Tue Jun 22, 2010 3:18 am
Posts: 5
Points: 0
I need to put this in the form of a function, please help!



<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>Teas of the World!</title>
</head>
<body>
<?php // Script 10.6 - Teas of the World.php
// This function a four cell table.
function makefourcelltable ($table){
echo "<table border='2'>
<tr>
<th>Chinese Fruit Tea</th>
<th>Mexican White Tea</th>
<th>Japanese Green Tea</th>
<th>British Camomille Tea</th>
</tr>";
}
echo "<tr>";
echo "<td>" . $table['Chinese Fruit Tea'] . "</td>";
echo "<td>" . $table['Mexican White Tea'] . "</td>";
echo "<td>" . $table['Japanese Green Tea'] . "</td>";
echo "<td>" . $table['British Camomille Tea'] . "</td>";
echo "</tr>";
echo "</table>";

?>
</body>
</html>


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
 Post subject: Re: I need to put this is a table!
PostPosted: Thu Jun 24, 2010 4:02 am 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
In the code you already have the function:
PHP Code:
function makefourcelltable ($table){
echo "<table border='2'>
<tr>
<th>Chinese Fruit Tea</th>
<th>Mexican White Tea</th>
<th>Japanese Green Tea</th>
<th>British Camomille Tea</th>
</tr>";
}

Then you just need to call it from where you want to have the printout:
PHP Code:
function(value);

This will print all your <th> tags. If you call the function several times then you get several lines.

_________________
Xavier Media®
Join me at LinkedIn | Get your latest blog post in your signature you too


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject: How do you get a function to display in a table?
PostPosted: Sun Jun 27, 2010 4:03 am 
Offline
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Tue Jun 22, 2010 3:18 am
Posts: 5
Points: 0
I am so confused I have to get this function to display in a table and I really dont know how, I have tryed this so many times and just dont get it. HELP!



<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>Teas of the World!</title>
</head>
<body>
<?php // Script 10.6 - Teas of the World.php
// This function displays a four cell table.
function tea($types) {

$types = array ("Chinese Green", "Japanese Red", "Korean Black", "British White");

echo "<table border=1 cellpadding=1 cellspacing=1><tr>";
for ($cell = 0; $cell < 4; $cell++) { // Displays the cell count.
echo "<td>".$types[$cell]."</td>";
}

}

"</tr></table>";
?>
</body>
</html>


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
 Post subject: Re: I need to put this is a table!
PostPosted: Mon Jun 28, 2010 8:01 am 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
In the code you have in the above post you already have a function.

_________________
Xavier Media®
Join me at LinkedIn | Get your latest blog post in your signature you too


Report this post
Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Registered users: No registered users


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Portal » Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[
SEO MOD © 2007 StarTrekGuide ]