/    Sign up×
Community /Pin to ProfileBookmark

How do I add table border

Hi all, how do i add table border and table border color ?

<PHP>
echo ‘<table class=table table-striped table-bordered table-hover table align=”center””>’;

</PHP>

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@NogDogNov 01.2015 — Via CSS (i.e., really nothing to do with PHP). http://www.w3.org/TR/CSS2/tables.html
Copy linkTweet thisAlerts:
@doran_lumauthorNov 02.2015 — Thank you.. Can I also limit the amount of table to display ?

For example, I need the table to be display like 3/4 of the top screen due to a background picture which occupies the bottom.
Copy linkTweet thisAlerts:
@NogDogNov 02.2015 — You could stick it inside a div with the desired height, and set that div's style to include "overflow: auto" which will add scrollbars as needed. If you want to limit how many rows from a DB are actually used to populate the table (assuming it comes from a DB?), you could add a LIMIT clause to the DB query to specify how many rows to retrieve.
Copy linkTweet thisAlerts:
@doran_lumauthorNov 02.2015 — I guess it's something like div { height: 0; overflow: auto; }

where should i add the div statement ?

<PHP>

echo '<table class=table table-striped table-bordered table-hover table align="center" >';

echo "<table height='50%' style='border-bottom:1px solid #000000;' >";

echo "<tr><td>";


echo $row['CDYear'];

echo "</td><td>";


echo $row['CDPrice'];

echo "</TD></tr>";

</PHP>
Copy linkTweet thisAlerts:
@ginerjmNov 02.2015 — This whole post is about CSS, not PHP at all. Why don't you read about css and then ask you question in the proper forum?

PS - get rid of all that horrible looking table tag and read your html guide on what it is supposed to look like.
×

Success!

Help @doran_lum 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.18,
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,
)...