Click to See Complete Forum and Search --> : Changing the font size in a table?
Al Smith
May 27th, 2000, 09:26 AM
Hi,
I can't seem to find the way to change the font size in an ASP generated table.
Is it in a seperate Font tag or in the Table tag or ???
Thanks,
Al.
You can do it a couple of different ways(whatever tool they[vBulletin] use to parse through the tags keeps inserting their own properties in some of the tags; because of this the example of using font tags has to extra properties that should be removed, the hardcoded values for font face and size):
<% Option Explicit %>
<html>
<style type="text/css">
td.title {font-family:verdana;font-size:12pt;font-weight:bold;}
td.row {font-family:verdana;font-size:10pt;}
</style>
<body bgcolor="#FFFFFF>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<FONT FACE="verdana" size="3">
<b>Using Font Tags</b>
</font>
</td>
</tr>
<%
Dim i
Dim intFontSize, strFontFace
intFontSize = 2
strFontFace = "Verdana"
For i = 1 to 20
%> <tr>
<td>
<FONT SIZE="2" FACE="arial, helvetica" face="<%= strFontFace %>" size="<%= intFontSize %>">
<%= "MyRecordsetRow " & i %>
</font>
</td>
</tr>
<%
Next
%>
</table>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="title">
Using Style Sheets
</td>
</tr>
<%
For i = 1 to 20
%>
<tr>
<td class="row">
<%= "MyRecordsetRow " & i %>
</td>
</tr>
<%
Next
%>
</table>
</body>
</html>
Roughly translated you must put <FONT> tags in every table cell you want change the font of.
<table>
<tr>
<td>
<FONT SIZE="2" FACE="arial, helvetica" size="4">Text</font>
</td>
<td>
<FONT SIZE="2" FACE="arial, helvetica" size="-1">Text</font>
</rd>
</tr>
</table>
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.