Forum Moderators: open

Message Too Old, No Replies

DIV inside TD is not aligned to center

         

salieri

11:07 am on Apr 20, 2006 (gmt 0)

10+ Year Member



Hi guys,

I am rather new in all this stuff, and now I have some prob:
I have follwing code
<td align=center width=400>
<div>
<tr>
<td width=100%> some text </td>
</tr>
</div>
</td>

But the inner TD with the text is NOT aligned to the center, but right.
I have tryed everything I knew - no result.
When I apply style=padding-right:XXpx it works, inner TD moves left, but I don't like this solution at all.
So please, could somebody tell me what the hell is going on?
Thanks you:)

henry0

11:35 am on Apr 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld!

Here is what you have
(We need to look at your CSS too)
<<<
<td align=center width=400>
<div>
<tr>
<td width=100%> some text </td>
</tr>
</div>
</td>
>>>
A few things:
Use double quote with your width and align
="center" & "400"
Also depending on your CSS the <div> is not positioned ok.
What are you expecting?
Positioning a block or formatting some text?
<tr>
<td width="100%" align="center">
<div class="my_div"> some text</div>
</td>
If you want to position a block
Using HTML and CSS is almost "over killing"
If you may use CSS for formatting within a table
Or simply start learning how to only use CSS
and keep tables when a real tabular rendering is required.

salieri

11:43 am on Apr 20, 2006 (gmt 0)

10+ Year Member



Hi
Actually I want to place DIV in the middle of TD.
So I suppose that TD must be set in proper way?

henry0

11:55 am on Apr 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In that case use it as I posted it