473,836 Members | 2,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP - Changing the font sizes of HTML output

12 New Member

This is probably really simple to most of you but I have a PHP based website that I want to change the font (of the outputted HTML) and I'm really struggling! Here is a snippet of my code:

Expand|Select|Wrap|Line Numbers
  2. echo "<font face='arial' size='1'>";
  3.     echo "
  4.     <TABLE BORDER=1>
  5.     <TR>
  6.     <TH>Call Reference Number</TH>
  7.     <TH>Techncian</TH>
  8.     <TH>User</TH>
  9.     <TH>Call Description</TH>
  10.     <TH>Call Category</TH>
  11.     <TH>Call Priority</TH>
  12.     <TH>Call Resolution</TH>
  13.     <TH>Time Taken in hours</TH>
  14.     <TH>Time Taken in minutes</TH>
  15.     <TH>Date Logged</TH>
  16.     </TR>
  17.     </font>";
  19. // Enter results in table
  21. while ($row=mysql_fetch_array($sql_result)) {
  22.     $call_id=$row["Call_ID"];
  23.     $user=$row["User"];
  24.     $user_logged=$row["User_logged"];
  25.     $call_desc=$row["Call_Desc"];
  26.     $category=$row["Category"];
  27.     $priority=$row["Priority"];
  28.     $resolution=$row["Resolution"];
  29.     $time_hrs=stripslashes($row["Time_Hrs"]);
  30.     $time_mins=$row["Time_Mins"];
  31.     $date_logged=$row["Date_Logged"];
  33.     echo "<font face='arial' size='1'>
  34.     <TR>
  35.     <TD><INPUT type=\"text\" readonly=\"readonly\" name =\"call_id\" value=\"$call_id\"></TD>
  36.     <TD>$user</TD>
  37.     <TD>$user_logged</TD>
  38.     <TD>$call_desc</TD>
  39.     <TD>$category</TD>
  40.     <TD>$priority</TD>
  41.     <TD>$resolution</TD>
  42.     <TD>$time_hrs</TD>
  43.     <TD>$time_mins</TD>
  44.     <TD>$date_logged</TD>
  45.     <TD>
  46.     <p align=center><INPUT type=\"submit\" value=\"Delete Call\"></p>
  47.     </TD>
  48.     </TR>
  49.     </font>"; 
The font is changing to arial but I really can't get the font size to change. Can anyone help??

Thanks in advance.

Mar 30 '06
15 40993
9,065 Recognized Expert Moderator Expert
In that case I think possibly what you need to do is individually set column widths for each column, add a width attribute to each th tag.

However it would be easier to comment if you could either post a link to the page or post a complete page (as obtain from a view source in your browser).
Mar 31 '06 #11
12 New Member
I actually have tried adding <th width=40> but again it doesnt seem to take affect. Here is my source code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<TITLE>Displa y Call</TITLE>
<link href="main.css" rel="stylesheet " type="text/css">

<table border=1>
<TH>Call ID</TH>
<TH>Techncian </TH>
<TH>Call Description</TH>
<TH>Call Category</TH>
<TH>Call Priority</TH>
<TH>Call Resolution</TH>
<TH>Time Taken in hours</TH>
<TH>Time Taken in minutes</TH>
<TH>Date Logged</TH>
<TD width="900">1</TD>
<TD>Test User</TD>
<TD width=1% height=100>Test ing with a long string hhhhhhhhhhhhhhh hhhhhhhhhhhhhhh hhhhhhhhhhhhhhh hhhhhhhhhhhhhhh hhhhhhhhhhhhhhh hhhhhhhhhhhhhhh hhhhhhhhhhhhhhh hhhhhhhhhhhhhhh hhhhhhhhhhhhhhh hhhhhhhhhhhhhhh hhhhhhhhhhhhhhh hhhhhhhhhhhhhhh hhhhhhhhhhhhhhh hhh</TD>

Mar 31 '06 #12
9,065 Recognized Expert Moderator Expert
Oops, just spotted another error

you do not need the <style>...</style> tags in your css file, you only need those if you put your css into the <head> of your html file.
Mar 31 '06 #13
12 New Member
Changed but again no joy! Not to worry, I'll keep chipping away at it, thanks for the help though!
Mar 31 '06 #14
9,065 Recognized Expert Moderator Expert
Yeah I realised that after I tried it but the style tags are still wrong there so leave them out.

The HTML you posted seems to work ok for me with the CSS you posted. You have set the table width to 72px which is only 10% of the width of the screen, however the table is being sized to it's minimum width.

The minimum width of the table is calculated from the minimum width of all the cells. The minimum width of the cell is dependent on the longest single word as line breaks can only be inserted where there is white space.

I'm not quite clear on the layout you are after since the layout achieved looks quite reasonable to me.
Mar 31 '06 #15
12 New Member
I think I may have hit on the problem. It would appear that testing with data such as sssssssssssssss sssssssssssssss sssssssssssssss sssssssssssssss sssssssssssssss sssssssssssssss sssss isnt the best idea, when I break this up, i.e. sss sss sss sss, the width of the table reduces and new lines for each word are inserted.

Would this make sense to you!? Anyway problem resolved, I'll try not to be so naive in the future!

It appears you have picked up on this in your last message!
Mar 31 '06 #16

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Cengiz Ulku | last post by:
Hi all, I know now how to change the font name of a RTF file in a RTB control using, for example: RTextBox1.SelFontName = cmbFonts.Text I have a RTF file -created with Word- displayed in a RTB control. Whenever I change the font type during the runtime by selecting a font name from a combobox -of all system fonts, the text changes its font correctly but I loose some formatting such as a bold text and/or titles become normal text.
by: Haines Brown | last post by:
I've been setting font-size 1em; as the default in my style sheets. Until now, that seemed to be ok. But now I'm beginning to wonder. My aim is to have an easily readable, but not overly large text when the user uses the default font size in his browser and uses the typical display resolution. I did a reinstall of my friendly browser in a different environment, and I am surprised to find that its default for serif is Times 16 and
by: J | last post by:
I've run CSSCheck on my style sheets and I always get a warning similar to this: "font: bold 9pt/100% sans-serif Warning: Absolute length units should not generally be used on the Web ..." Yet if I use 'x-small' instead of 9pt, I get bigger type on IE6 and smaller type on Mozilla. My choices seem to be:
by: François de Dardel | last post by:
I have a complete Intranet site with about 140 pages using Verdana as the basic font. How do I place a table (12 columns) with Arial instead of Verdana, only for that table. I have defined a style in my CSS and tried to apply it to the table, doesn't work. I have tried to wrap the table in a div with the style. Doesn't work. I have tried the old-fashioned <font> tag, doesn't work. I must be doing something wrong. It works however if I...
by: Pamel | last post by:
I know this must have been asked elsewhere, but I cannot find it. There is a piece of text on my web page that I don't want browsers to resize. IE won't resize it if I specify the size in px, but everything else will. Is there any way to prevent browsers from resizing text? If you could just point me to where this has already been answered, that would be great. Paul
by: chart43 | last post by:
> I work on Windows (unfortunately). But I regularly view my work in a Mac > (IE5.x and Safari). I do not notice the phenomenon that you describe. > But then, it hardly seems relevant. What's important is that 100% is > right for you on your setup, and right for someone else on their setup, > whatever there os is. > >> normal in my case results in too big on Windows. My code is all >> valid, so too are style sheets. > > I doubt you have...
by: Paul D. Sullivan | last post by:
I've been trying to find out how to increase the font size in the text entry fields in Invision Power Board 1.3 for a while. The part where you enter your post and do the quick reply and all that has a really small font by comparision to the display font in the forum, and I wanted to at least have the same size if possible. After some hours of working the issue, I tested about every relevant entry in the Style Sheet. I found one line...
by: deko | last post by:
As I understand it, most browser manufacturers have agreed on 16px for their default font size. So, this should be an accurate conversion for percentages: px % 16 = 100 14 = 87.5 13 = 81.25
by: Randy Shore | last post by:
I have run into a problem with the new rich text control in Access 2007. It seems that you can only choose from 6 preset font sizes when entering or editing text. The sizes are 8,10,12,14,18,24,36, which as I understand it, corresponds to Font Size=1 through Font Size = 6 in HTML. Is there any way around this. I have a need to display the data at 46pt, and also to make fine discriminations in font size depending on the data displayed. ...
by: praCash | last post by:
Hi guys, I have done a ppllication. for Cotnent management system. in it i have designed my content. but after creating content for every page i desided to increase the font sizes. as the previously designed pages are more I cannot wast my time while updating(Changing) each and every page. i need some other solution instead of updating every page. just like a short cut.
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.