473,245 Members | 1,660 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,245 software developers and data experts.

how to close table

hello and please excuse me again for my clumsy english.

As I wrote few weeks ago, I'm not programer, but I have to create one
script. that is a gallery script, and after successful work on flatfile
gallery script I'w decided to build mysql script.
frontend is almost done, everything is working fine, except ending of
tables..

I will try to describe and draw what I mean:

if I have 8 pics to be shown, and if choose to have 4 columns in row,
table will close fine:
<table>
<tr><td>IMG</td><td>IMG</td><td>IMG</td><td>IMG</td></tr>
<tr><td>IMG</td><td>IMG</td><td>IMG</td><td>IMG</td></tr>
</table>

but, if I have 9 pics, i will have "hole" in my table:

<table>
<tr><td>IMG</td><td>IMG</td><td>IMG</td><td>IMG</td></tr>
<tr><td>IMG</td><td>IMG</td><td>IMG</td><td>IMG</td></tr>
<tr><td>IMG</td></tr>
</table>

now... how to draw those missing <td>&nbsp;</td>?
or to create <td colspan=\"$somenumber\"> ?

how to calculate that $somenumber ?
(that solution with colspan is easier, but I would like to learn both
solutions)

here is one part of my code:
(I believe that it can be written much nicer, but again, I'm just
starting with your language... php I mean.)

function collect_authors() {
global $incl, $incp, $tbrd, $PHP_SELF, $i;

print "<table border=\"$tbrd\" cellspacing=\"0\"
cellpadding=\"$incp\"><tr>\n";

// subfunction get AUTOR
$query1 = "SELECT AutorID,AutorName,AutorPrez,AutorPict FROM
autor";
$result1 = mysql_query ($query1) or die ("shit, f*query failed
($query1)");
while (list($AutorID,$AutorName,$AutorPrez,$AutorPict) =
mysql_fetch_array($result1)) {
// takeing picture size and calculating squized
thumbnail
list($width, $height, $type, $attr) =
getimagesize("faces/$AutorPict");
$smal = $width / 50;
$heih = floor($height / $smal + 0.5);
print "<td align=\"right\" valign=\"top\">\n\n".
"<table width=\"100%\" border=\"0\"
cellspacing=\"2\" cellpadding=\"0\">\n<tr>\n<td colspan=\"2\"
align=\"left\" valign=\"bottom\">\n".
"<a class=\"autor\"
href=\"$PHP_SELF?AutorID=$AutorID\"><br>$AutorName
$AutorPrez</a>\n</td>\n</tr>\n".
"<tr>\n<td align=\"right\" valign=\"top\">\n".
"<p>\n<img class=\"pict\" src=\"faces/$AutorPict\"
alt=\"$AutorName\" width=\"50\" height=\"$heih\">\n</p>\n".
"</td>\n<td align=\"left\" valign=\"top\">\n";

// subfunction get ALBUM
$query2 = "SELECT AlbumID,AlbumName FROM album WHERE
AutorID=$AutorID";
$result2 = mysql_query ($query2) or die ("shit, f*query
failed ($query2)");
while (list($AlbumID,$AlbumName) =
mysql_fetch_array($result2)) {
print "<p>\n<a class=\"album\"
href=\"$PHP_SELF?AlbumID=$AlbumID\">$AlbumName</a>\n</p>\n";
}
print "</td>\n</tr>\n</table>\n\n</td>\n";
$i++;
if ($i % $incl == 0) {
print "</tr>\n<tr>\n";
}
}
print
"</table>\n\n";
}

tnx for any help.

--
Jan_ko?
--
Jul 17 '05 #1
1 2526
function collect_authors() {
global $incl, $incp, $tbrd, $PHP_SELF, $i;

print "<table border=\"$tbrd\" cellspacing=\"0\"
cellpadding=\"$incp\"><tr>\n";

// subfunction get AUTOR
$query1 = "SELECT AutorID,AutorName,AutorPrez,AutorPict FROM
autor";
$result1 = mysql_query ($query1) or die ("shit, f*query failed
($query1)");
while (list($AutorID,$AutorName,$AutorPrez,$AutorPict) =
mysql_fetch_array($result1)) { ---snip $i++;
if ($i % $incl == 0) {
print "</tr>\n<tr>\n";
}
} if ($i % incl) {
print "<td colspan="($i % $incl)"></td>";
} print
"</table>\n\n";
}

tnx for any help.

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kevin dalby | last post by:
I use the script below to open a side panel on my desktop without all the buttons and menu items. IE 6 It works well. What I'd like to add is add a line of code that will close the calling...
3
by: Asit | last post by:
<META HTTP-EQUIV="expires" content="0"> <META HTTP-EQUIV="pragma" content="no-cache"> <html> <head> <title>Fidelity NetBenefits</title> </head> <body BGCOLOR="#ffffff"> <script...
6
by: marcelf3 | last post by:
Hello.. This page opens a window with some information, but everytime the user changes a field in the parent window, the child window needs to be closed. These 2 functions were supposed to do the...
19
by: Lauren Wilson | last post by:
A2K app: Question: is the flagged line (<<<) below necessary. If that line is needed, what effect does it have (if any) on the fact that the very same database is the linked back end db? ...
0
by: bonita | last post by:
In my ASP.NET page, I have 2 checkboxes for users to choose which crystal report they want to display. These two reports use different tables. If report1 has been choosen and displayed in the...
1
by: oliver gargour | last post by:
Hello, I am using the following code in a popup. <html> <head> <title></title> </head> <body onLoad="this.focus();" onblur="self.close"> <form action="" method="get">
15
by: Andyza | last post by:
I'm looking at another developers code and I'm now confused about the correct way to close a database connection and destroy the object. I would normally do it this way: Set conn =...
4
by: Martin Arvidsson, Visual Systems AB | last post by:
Hi! I am currently developing my first webapplication using .net (2.x) In a couple examples seen in the helpfile that came with VS2008 i see that they are opening a connection to the sql...
1
by: =?Utf-8?B?TG91aXM=?= | last post by:
Our code is shown as below. Does anyone knows why the sleep connection not close? <HTML> <HEAD> <TITLE>TheBestSteakHouseStL.com - Reviews</TITLE> <meta http-equiv="Content-Style-Type"...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.