Forum Moderators: not2easy
I am trying to find a way to control the format of text that appears within tables, and within tables within tables
(ie -
<table><tr><td>
<table><tr><td>ddd</td></tr></table>
</td></tr></table>
without putting anything in the head or the <table><tr> or <td> tags and without having to put the <font> tag around each piece of text within the <td>'s.
"ddd" in the above is obviously the text I want to control.
I was hoping I could place the table(s) within a <div> in which I defined the font format of everything within that <div> (including the text within the table(s)) but it doesn't seem to want to play.
Can this be done and if so how? Any help greatly appreciated
You said "without putting anything in the head or the <table><tr> or <td>...".
At the least, you will need to add something to the head of the doc, like a <link /> to an external stylesheet.
Your plan to wrap the table(s) within a div should be fine. That way you can control just those tables without messing with other ones elsewhere on the page.
Something like:
<div id="myfont">
<table><tr><td>
<table><tr><td>ddd</td></tr></table>
</td></tr></table>
</div>
CSS:
#myfont table{font: 1em Verdana}
I too have been having some troubles with tables and inheritance lately, to the point where I have to define certain styles inline for them to work.
eg:
<div style="font-family:arial;font-size:10pt;">
<table width="100%" border="0" cellspacing="0" cellpadding="4" style="border: solid 1px #cccccc">
<tr>
<td>Team Name</td>
<td width="100"><div align="center">Pages Created</div>
</td>
<td width="100"><div align="center">Total Raised</div>
</td>
</tr>
<tr bgcolor="white">
<td><a href="#">Team1</a></td>
<td width="100"><div align="center">1</div>
</td>
<td width="100"><div align="center">$4009.98</div>
</td>
</tr>
<tr bgcolor="lightgrey">
<td><a href="#">Team 2</a></td>
<td><div align="center">34</div>
</td>
<td><div align="center">$8399.22</div>
</td>
</tr>
</table>
</div>
Because of what I am building, I can't get to the inner table tags (our clients can add HTML within a template we set-up through an online WYSIWYG editor - so if they create a table within that editable area of the template, I want to be able to define a default font face and size)
Thanks again
So, you could go back to the original plan and define your styles inside the <body>
<body>
<style type="text/css">
#myfont table,#myfont td(font: Arial 12pt)
</style>
<div id="myfont">
...
..
.
</div>