|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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> |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||||||
|
|||||||
|
Quote:
Only use <table> for tabular data! Quote:
Astute observation Quote:
Remind me again, what are "Javascript pt sized letters"? Quote:
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:
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! |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Tables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|