PHP TABLE FORMATTING
Moderator: General Moderators
-
polosport6699
- Forum Commoner
- Posts: 35
- Joined: Wed Jun 11, 2003 3:19 pm
PHP TABLE FORMATTING
I have been searching for days on the acutal formatting of a MYSQL table in php - to form the html side of it. I want to know how to make a table, give it color, define the column sizes and headings, then put the mysql data in it.
Anyone please help I would be very greatful
Anyone please help I would be very greatful
-
polosport6699
- Forum Commoner
- Posts: 35
- Joined: Wed Jun 11, 2003 3:19 pm
Helllp
I dont think you know exactly what im asking.
I want to learn about the end result of the table shown on say
Monster.com. How do I format my tables with php to make them look like that, with colors and pre-definied sizes.
I know how to make a table in mysql and to edit and change values within that but I do not know how to Display the table in php colorfully with images and also predefined column sizes...?
Any help would be quite nice
I want to learn about the end result of the table shown on say
Monster.com. How do I format my tables with php to make them look like that, with colors and pre-definied sizes.
I know how to make a table in mysql and to edit and change values within that but I do not know how to Display the table in php colorfully with images and also predefined column sizes...?
Any help would be quite nice
- caseymanus
- Forum Commoner
- Posts: 34
- Joined: Wed Nov 20, 2002 10:32 pm
- Contact:
-
polosport6699
- Forum Commoner
- Posts: 35
- Joined: Wed Jun 11, 2003 3:19 pm
Aaarg. I KNOW HTML VERY WELL. WHAT I DONT KNOW IS HOW TO FORMAT THE TABLES FOR MYSQL DATA. I KNOW <TABLE></TABLE> CELLSPACING ECT. HOW DO I GET MYSQL TBL DATA INTO IT. I am just learning php
Im talking about formatting of tables using the print function[/b[
Like so
print "<TABLE BORDER=\"0\" align=\"center\" width=\"480\"><TR bgcolor=\"5C83D3\">\n";
print "\t<td><input name=\"check\" type=\"checkbox\" value=\"check\"></td>\n";
foreach ($line as $col_value) {
print "\t<td>$col_value</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
I do not know anything about that, if someone could help me with THAT type of table formatting I would be gracious
Im talking about formatting of tables using the print function[/b[
Like so
print "<TABLE BORDER=\"0\" align=\"center\" width=\"480\"><TR bgcolor=\"5C83D3\">\n";
print "\t<td><input name=\"check\" type=\"checkbox\" value=\"check\"></td>\n";
foreach ($line as $col_value) {
print "\t<td>$col_value</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
I do not know anything about that, if someone could help me with THAT type of table formatting I would be gracious
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
yo
maybe something like this:
hope that helps a little bit.
maybe something like this:
Code: Select all
<table border="1" width="100%">
<tr bgcolor="yellow" align="center"><td><b>First name</b></td><td><b>Last nameb></td></tr>
<?php
$result=mysql_query("select * from addressbook", $db) or die(mysql_error());
while ($myrow=mysql_fetch_row($result)) {
echo "<tr><td>$myrow[0]</td><td>$myrow[1]</td></tr>";
}
?>
</table>zoki wrote:Code: Select all
<?php echo "<tr><td>$myrow[0]</td><td>$myrow[1]</td></tr>"; ?>
Code: Select all
<?php
// you don't always have to concatenate but it helps:
echo '<tr><td>' . $myrow[0] . '</td><td>' . $myrow[1] . '</td></tr>';
?>Code: Select all
<?php
// declare vars
include('path_to/template.htm');
?>Code: Select all
<?php echo $var1; ?> etc
Last edited by McGruff on Thu Aug 11, 2005 6:01 am, edited 1 time in total.