Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table/Text Formatting

Status
Not open for further replies.

ljwmis

MIS
May 23, 2001
48
GB
Apologies if this or similar has been asked before.

I have inserted a table into a webpage where the body text is controlled by CSS. Just the usual set up:

<table fontborder=&quot;0&quot; align=&quot;center&quot; width=&quot;100%&quot;>

<tr align=&quot;left&quot; valign=&quot;top&quot;>
<td></td>
<td></td>
/tr>
<tr align=&quot;left&quot; valign=&quot;top&quot;>
<td></td>
<td></td>
</tr>

The table looks fine, however I seem unable to control the format of the text. The text is huge compared to the surrounding text and seems to be in bold. I have tried font-size in <table> and have experimented with this in CSS (not exactly sure how to control tables formatting in CSS), but to no avail.

Any suggestions greatly appreciated.

p.s. Could you suggest how to set up CSS to control table layout/formating etc.

Many thanks.

 
Hello ljw!

Table always needs its own formatting (CSS). So you need to apply your CSS style for text to table. There are couple of ways to do it:
1) <table class=&quot;your_CSS_style&quot;.....>........</table>
2) <table style=&quot;font-size: 80%&quot;.....>........</table>

Please note, that IE and NS differently display some styles attached to table. To be sure that it will work both in IE and NS I do two things:
1) apply CSS to whole TABLE (like I describe above)
2) and apply the same CSS also to each TD that has text: <td class=&quot;some_CSS_style&quot;>.

I know that it makes code longer but it works in both browsers.

Good Luck!
 
This is a bug in IE5's cascading. Font styles should cascade through all elements. This works correctly in Netscape 6/Mozilla -- and I am hoping they fix this in IE6.

I hate how IE5's CSS bugs. Its implementation is not really all that great. ===
Supports Mozilla and Web Standards
Knows HTML/XHTML, CSS1, JavaScript, PHP, C++, DOM1
===
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top