Forum Moderators: not2easy

Message Too Old, No Replies

Quick simple HTML Question

How do I change size of text within a table?

         

Dino_M

9:04 pm on Dec 5, 2002 (gmt 0)

10+ Year Member



Have tried a few things but it's not happening, think I'm to tired been at the keys for 15hrs straight.
So hows it done?

andreasfriedrich

9:06 pm on Dec 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



td {
font-size:1000%;
}

Dino_M

9:20 pm on Dec 5, 2002 (gmt 0)

10+ Year Member



sorry kinda new to this programming lark more of a marketing geek but the above looks a like some CSS? is that they only way to control table text size?

SuzyUK

9:46 pm on Dec 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No it's not the only way but it's considered here (on this forum anyway) to be the best! ;)

However if your table is all to be the same size in HTML in can be done like this e.g.:
<table border="1" cellpadding="2" cellspacing="0" width="100%" font size="6" style="font-family: Tahoma; font-size: 10pt">

However this is only a variation on CSS as in it is classed as an in-line style as opposed to an embedded or external style

or the really long winded way, i.e. no CSS i.e. pure HTML is to apply the font-size setting to each individual cell, but this is where "code bloat" comes in..
table properties as per normal
then:
<td><font size="2">your text here</font></td>

and this needs to be done for each cell witin your table

whereas with andreas' suggestion you type the following lines

<style type="text/css">
td {font-size: 10pt}
</style>

within the head tags of your document (embedded style)..and reduce the need to type the font size (open and close tags) for each cell

Welcome to the marvels of CSS, don't be put off, it can reduce your code..
and if you ever want to change that font-size you only need to amend one line and not every instance within your document

and that's only embedded you should try external...that means one change for an entire website if you want..

Suzy
:)

Dino_M

9:55 pm on Dec 5, 2002 (gmt 0)

10+ Year Member



cheers

have been using CSS for postioning but see that it will be getting used more and more on my site.