Go Back   Wiki NewForum | Latest Entertainment News > Career Forum & Tips > Tech Forum & Tutorial > HTML Forum & Tutorial


How to specify font styles for text inside tables, the easy way


Reply
Views: 2850  
Thread Tools Rate Thread
  #1  
Old 08-09-2010, 12:23 PM
bholas bholas is offline
Award Winner
 
Join Date: Apr 2010
Posts: 4,977
Default How to specify font styles for text inside tables, the easy way

If you're using font tags inside large tables to change the style of the text inside cells, you maybe making your pages larger than necessary.
Let's look at the following sample table. Note how the FONT tags are being used to set the font style of text inside each cell. If you have a large table, these font style tags could multiply the size of your page, specially if the text inside the cells are smaller than the font tags.











test 1

test 2

test 3

test 4

Listing #1 : HTML code. Download tblcss1.html (0.22 KB).


If your visitors are using Cascading Style Sheets enabled browsers such as {X_CSSBROWSERS} or compatible, you could use the TD{font-family: Arial; font-size: 10pt;} style sheet tag as follows. Doing so will make text inside all TD tags use the specified font face and other specified attributes such as the font size.













test 1
test 2
test 3
test 4




Listing #2 : HTML code. Download tblcss2.html (0.29 KB).

Reply With Quote
Reply

Tags
website tips

New topics in HTML Forum & Tutorial





Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
WikiNewForum)