Jump to content

[SOLVED] Why isn't this working?


MsRedImp

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/75263-solved-why-isnt-this-working/
Share on other sites

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>

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">

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.