HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 2nd, 2005, 08:55 AM
speedy33417 speedy33417 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 70 speedy33417 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 10 m 44 sec
Reputation Power: 4
Tables

Working on a table. (I guess you figured as much from the title) Anyway, I use plain html and I read it somewhere here, that I shouldn't use <font></font> anymore as it won't be supported any longer.
Also, I noticed that if someone changes the text size settings in their browser than the regular sized letters become larger, however if I use JavaScript pt sized letters they won't. Correct me if I'm wrong.

Which makes me jump into learning yet another programming language. Could someone please help me make a transition from html to JavaScript? Will I have to write my code in all JavaScript or will it be a mix of both html and JavaScript?

Here's a portion of the code. How do I get rid of the <font> tags and make the letters 12pt instead of size 2?

Thanks for your help.

Code:
<div align="center">
	 <table border="0" width="470" cellspacing="0" cellpadding="0">
	 <tr>
	 <td width="90">
	 <font face="Verdana" size="2" color="#333399">Address (1)</font>
	 </td>
	 <td width="5"></td>
	 <td>
	 <input name="WhateverIWant" size=35 maxlength=35>
	 </td>
	 </tr>
</div>

Reply With Quote
  #2  
Old March 2nd, 2005, 09:10 AM
Mike_W Mike_W is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Liverpool, UK
Posts: 110 Mike_W User rank is Private First Class (20 - 50 Reputation Level)Mike_W User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 7 h 54 m 51 sec
Reputation Power: 5
Learning JavaScript really isn't that hard. You use JavaScript integrated into HTML. If I wanted to do what you want to do I'd use a style sheet.

Put the following inside your <head></head>:

Code:
<style type="text/css">
.nameoffont { FONT-SIZE: 12pt; COLOR: #333399; FONT-FAMILY: verdana }
.nameoffont2 { FONT-SIZE: 16pt; COLOR: #333399; FONT-FAMILY: verdana }
</style>


Then put the following in:

Code:
<div align="center">
	 <table border="0" width="470" cellspacing="0" cellpadding="0">
	 <tr>
		 <td width="90" class="nameoffont">Address (1)</td>
		 <td width="5"></td>
		 <td><input name="WhateverIWant" size=35 maxlength=35></td>
	 </tr>
</div>


You set up however many font styles as you want then just refer to them with the class="". You can have any name for the font style as you want, but it's good practice to call it something obvious, such as tablefontlarge, for a style to be used in a table that will be large.

This does result in a problem when the user tries to increase or decrease the size of the text, though. Someone else may have a better solution for you.

Reply With Quote
  #3  
Old March 2nd, 2005, 10:43 AM
Phoenix's Avatar
Phoenix Phoenix is offline
Web-Standards Evangelist
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Posts: 1,522 Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level)Phoenix User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 23 h 48 m 4 sec
Reputation Power: 8
Quote:
Originally Posted by speedy33417
Working on a table.


Only use <table> for tabular data!

Quote:
Originally Posted by speedy33417
(I guess you figured as much from the title) Anyway, I use plain html and I read it somewhere here, that I shouldn't use <font></font> anymore as it won't be supported any longer.


Astute observation

Quote:
Originally Posted by speedy33417
Also, I noticed that if someone changes the text size settings in their browser than the regular sized letters become larger, however if I use JavaScript pt sized letters they won't. Correct me if I'm wrong.


Remind me again, what are "Javascript pt sized letters"?

Quote:
Originally Posted by speedy33417
Which makes me jump into learning yet another programming language. Could someone please help me make a transition from html to JavaScript? Will I have to write my code in all JavaScript or will it be a mix of both html and JavaScript?


JavaScript is now known as "ECMAScript" which is the standardised version, you also have to use the W3C DOM to ensure rich applications work consistently accross all modern browsing platforms

Quote:
Originally Posted by speedy33417
Here's a portion of the code. How do I get rid of the <font> tags and make the letters 12pt instead of size 2?

Thanks for your help.


WebStandardsMan reporting... I'll take it from here

Code:
<div align="center">
	 <table border="0" width="470" cellspacing="0" cellpadding="0">
	 <tr>
	 <td width="90">
	 <font face="Verdana" size="2" color="#333399">Address (1)</font>
	 </td>
	 <td width="5"></td>
	 <td>
	 <input name="WhateverIWant" size=35 maxlength=35>
	 </td>
	 </tr>
</div>


Begone vile evil HTML3.2 code! BE SEMANTIFIED!!!!

Code:
<form action="your-form-handler.ext" method="post/get">
	<fieldset>
		<legend>Your form title</legend>
		<dl>
			<dt><label for="txaAddress">Address</label></dt>
			<dd><textarea id="txaAddress" name="Address"></textarea></dd>
 
			<dt><label for="txaWhatever">Whatever</label></dt>
			<dd><input type="text" id="txtWhatever" name="Whatever"></textarea></dd>
		</dl>
	</fieldset>
</form>


aaaaand the CSS:

Code:
dl { width: 470px; }
dt { font-face: Verdana Arial sans-serif; color: #339; size: 1.2em; }


done and done

*WebStandardsMan flies away!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Tables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT