/    Sign up×
Community /Pin to ProfileBookmark

arrrgh! why doesn’t this work?

Ihave this php code:

if ($num_rows > 0)
{
echo ‘<table class=”table” width=”500″ cellspacing=”2″ cellpadding=”2″>
<tr><th>Name</th>
<th>Concern</th></tr>’;

while ($row = mysql_fetch_array($result, MYSQL_BOTH))
{
echo “<tr><td align=”left”>$row[0]</td>
<td align=”left”>$row[1]</td></tr>n”;
}
echo ‘</table>’;
mysql_free_result ($result);

mysql_close(); //close the database connection.
}

This creates a table but doesn’t display the grid between the columns. Why???

Rut

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogDec 07.2005 — If you're just talking about the borders between table cells, that's a HTML/CSS issue, not a PHP one. Just add this to your CSS:
<i>
</i>.table {
border-collapse: collapse;
border: solid 2px black; /* adjust color/thickness as desired */
}
.table th, .table td {
border: solid 1px black;
padding: 2px;
}
Copy linkTweet thisAlerts:
@rutledjauthorDec 07.2005 — Thanks so much

Rut
×

Success!

Help @rutledj spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...