Code2Design.com

User login

The Layout

Programming

Graphic Design

Resources

Navigation

C2D Projects

Unsystematic Affiliates

Tutorial Mix Photoshop Star Fresh Tuts Learn PHP Free 

Change Language

Who's online

There are currently 0 users and 30 guests online.

Font select

How do I select a smaller font for a table on a web page in PHP. I have a site (localhost currently) that displays records of a logbook and I have limited the output to 20 rows per page but the font is standard. How do I make the font in the table smaller so that I can get 25 lines onto the screen without having to scroll.

Thanks


Submitted by Dmitri on May 9, 2007 - 4:27am.
printer friendly version

This looks like a job for - CSS!

I recommend using CSS to style your output after PHP prints the records to the table. For instance, look at the following code:

<html>

<head>
<title>My Page</title>

<style type="text/css">
td {
line-height: 15px;
color: #cccccc;
font:11px verdana, arial;
}
</style>

</head>
<body>

<table>
<tr>
<td>The Cell Text</td>
<td>The Second Cell Text</td>
</tr>
</table>

</body>
</html>

This will change all text inside the "TD" element to a size 11px font (and change the line height etc..)


Many thanks. I will try this

Many thanks. I will try this out this afternoon.
BY the way, you have a fantastic site and I have learnt huge amounts from this site. One last question. Will this work on Linux as I do not use windows?

Kind regards
Dmitri


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <br> <br /> <h3>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use BBCode tags in the text, URLs will be automatically converted to links
More information about formatting options



Like what you see?

Why not add more? C2D is looking for other Christian Web Masters who would like to help write articles for this site. If you have expericance in FLASH, CSS/HTML, PHP/MySQL, PhotoShop/GIMP, Blender, Javascript, or just General Design - our users would love to hear what you have to say. Contact Us

delicious   digg   reddit   magnoliacom   newsvine   furl   google   yahoo   technorati