tags:

views:

33

answers:

3

I can't get this list to align left

    <table width="100%">
    <tr>
        <td align="center">
            <asp:Panel ID="Panel1" runat="server" BackColor=White Height="604px" 
            Width="493px" >

                <ul align=left style="left:-60px;background:Black">
                    <li>Coffee</li>
                    <li>Milk</li>
                </ul> 

            </asp:Panel>
       </td>
    </tr>
</table>
A: 

I know this might sound weird, but why are you using a table instead of a div? Is this specifically data that is tabular in layout?

Usually you would use a div for none tabular data.

So you could do the following:

<div style="float:left">
Your list items here.
</div>
<div style="float:right">
Some other content here.
</div>

Remember to do the following though after:

<div style="clear:both"></div>
Datoon
+1  A: 

I agree with Datoon, if it's non tabular data then it's probably worth while to put this in a regular div. The following will align your text to the left, however.

<ul style="background:Black; text-align:left;">
   <li>Coffee</li>
   <li>Milk</li>
</ul> 
rickp
any idea why I can see the bullet points in visual studio design view but not in the browser(IE)?
nooob
You can set the `list-style-type` directly on the UL element: `list-style-type: disc;`.
rickp
A: 

Adding the following CSS rule to the parent <div> will get it to align properly:

div {
    text-align: left;
}

You can see it in action here.

Pat