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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tables question

Status
Not open for further replies.

786snow

Programmer
Nov 12, 2006
75
hi,

suppose I have something like this


Code:
<table<tr> <td style=font-size:20px;>
     <p>John</p>  
        
<table<tr><td>Bob</td></tr></table>
</td></tr></table>


Now I noticed my font applies at John but at Bob. I want to do it with out using style sheet that I have font defined at top level and it gets applied at all the child tables.
 
Why do you not want to do it using a stylesheet? And why do John and Bob need a table. And why does Bob need a table for himself inside John's table? If you apply the font on a body tag or whatever parent tag, unless specified elsewhere, the font will stick to all the child elements as well. However, the way you're doing it, already relies on CSS, so I still see no reason why you're against using stylesheets.
 
I'll assume that the above code is just a test case. I'll also assume that the typo in the code you've posted here isn't in your original - you're missing a > after [tt]table[/tt]:
Code:
<table[red]>[/red]<tr> <td style=font-size:20px;>
The font size should be inherited by the inner table in exactly the way you describe. The reason why it may not be happening is because your document could be rendering in "quirks" mode. Give your document a DOCTYPE (see for details) and it should work as you expect.

And, whilst inline styles and [tt]<style>[/tt] elements are fine for tinkering, stylesheets are definitely the way to go for production sites.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top