I have the following code:
<table>
<div class="std1">
<tr>
<td>First</td>
<td><input type="text" disabled="true" value="" /></td>
<td>Last</td>
<td><input type="text" disabled="true" value="" /></td>
</tr>
</div>
</table>
I am trying to style, I would like to target or select the TD tags within the DIV of class std1, I have tried the following and it does not work:
div.std1 TD{
font-family:arial, sans-serif;
color:black;
font-size:8pt;
font-weight: normal;
}
A table layout is extremely important because the page contains dynamic content.
Thanks,
FI
How to control Td of a specified TR
Hi forum Guy,
I don't think you can use a div inside a table around a tr, it shouldn't be valid markup.
Why not remove the div and give the class name to the tr or table.
<table> <tr class="std1"> <td>First</td> <td><input type="text" disabled="true" value="" /></td> <td>Last</td> <td><input type="text" disabled="true" value="" /></td> </tr> </table>
Hope that helps
How to control Td of a specified TR
Thanks for the reply Tony, excellent suggestion and it works, is there anywhere (I have read and used so many tutorials) that explains these rules and why what I was attempting to do is not rendered properly by the style engine.
Thanks,
FI
How to control Td of a specified TR
Hi forum Guy,
I'm not sure if there is any specific article that would help.
Browsers can be very forgiving and let developers get away with a lot of stuff that isn't valid. Best thing I can suggest is to keep validating Markup and CSS as you develop and learn from your mistakes.
Sites like http://hotwired.lycos.com/webmonkey/ and http://www.w3schools.com/ would be good sites to look for articles.
Hope that helps.
How to control Td of a specified TR
Great advise.
Thanks,
FI