MsRedImp Posted October 29, 2007 Share Posted October 29, 2007 I have a feeling this has something to do with where I placed the tags. For some reason this div tag isn't taking any effect on the text inside, if I change the color or size nothing happens. It may have something to do with the tables, but if I put it before the <td> and after the </td> it works, any help please? <div style="color: #FFFFFF; font-size:5px"> <tr bgcolor="#336699"> <td><b>1st</b></td> <td><b>Matt Smith</b></td> </tr> </div> Quote Link to comment Share on other sites More sharing options...
Dragen Posted October 29, 2007 Share Posted October 29, 2007 1. This is a html question, not php. 2. You've got div tags inside table tags, but not inside td tags. Quote Link to comment Share on other sites More sharing options...
MsRedImp Posted October 29, 2007 Author Share Posted October 29, 2007 Oh sorry, it's because my whole file is PHP. I will post in the HTML area. Quote Link to comment Share on other sites More sharing options...
Dragen Posted October 29, 2007 Share Posted October 29, 2007 I've just given you your answer. It's because you've got the div tags outside of the td tags. Quote Link to comment Share on other sites More sharing options...
MsRedImp Posted October 29, 2007 Author Share Posted October 29, 2007 Ah I understand what you mean. But if I put them inside the <td> tags I have to do the whole <div style> code for every row and column of text I want with that size and color, this is why I put it on the outside so that it can color and size many rows at once. Why isn't this working? I put a <div style> tag on the outside of the whole table form, so that all of the text inside is centered and a certain font, so why can't i put one inside? Here is the whole code: // This div code works and affects the text. <div style="position:absolute; LEFT:13px; top:90px; font-family:tahoma; text-align:center"> <table width="180" border="2" bordercolor="#004284" > // This one doesn't do anything, but I want more than one row to be affected. <div style="color: #FFFFFF; font-size:5px"> <tr bgcolor="#336699"> <td><b>1st</b></td> <td><b>Matt Smith</b></td> </tr> </div> <tr> <td>2nd</td> <td>James Ford</td> </tr> <tr> <td>3rd</td> <td>Ashley Jones</td> </tr> </table> </div> Quote Link to comment Share on other sites More sharing options...
Dragen Posted October 29, 2007 Share Posted October 29, 2007 I put a <div style> tag on the outside of the whole table form, so that all of the text inside is centered and a certain font, so why can't i put one inside? Because it's invalid html. The only things you can put in-between table tags are tr, td, and th. Remove the div and change the tr to this: <tr style="background-color:#336699; color:#ffffff; font-size:5px"> Quote Link to comment Share on other sites More sharing options...
MsRedImp Posted October 29, 2007 Author Share Posted October 29, 2007 Ah I see. I didn't know it was invalid html, thank you Quote Link to comment Share on other sites More sharing options...
Dragen Posted October 29, 2007 Share Posted October 29, 2007 if you want to check your html validation go to this link: http://validator.w3.org/ It will validate any web page and tell you what's wrong with it. You can also validate css here: http://jigsaw.w3.org/css-validator/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.