how to use css align control one row


Tags: c#,css

Problem :

I use visual studio 2010 with framework2.0

I design a page use c# ,now ,just called A.aspx.

the page have a table to layout, like

     <table> <tr>
        <td>
        Name
        </td>
        <td>
        <asp:TextBox .../>
        <div id="div1" style="vertical-align: bottom;">
         <img.. />
            </div>
        <div><img ../></div>
        <asp:Label .../>
        <asp:Label .../>
        </td>

        </tr>
       </table>

Now ,I want to let second<td></td> layout one row. how to set up?

I try <td style ="float:left"> but not worked,it always show two row.

can somebody help me with this?



Solution :

First understand your layout, here is an example with borders

If you want to float elements try a layout using div and css

A layout with tables is very hard to work with and nobody is doing it anymore. You can use tables for specific situation only if you like but most of the time try to use div layout and the other elements to organize content.

HTML

<table class="borde">
<tr class="borde">
<td class="borde">
Name
</td>
<td class="borde">
fffff
<div class="divRojo"></div>
fffff 
</td>

</tr>

</table>

CSS

 .borde { border:1px solid black; }

 .divRojo { border:1px solid red; }

With one more row and the div

<table class="borde">
<tr class="borde">
<td class="borde">
Name
</td>
<td class="borde">
fffff
<div class="divRojo"></div>
fffff 
</td>

</tr>

<tr>
   <td colspan="2">
   <div>Content in one column in a new row</div>
   </td>
</tr>


</table>

    CSS Howto..

    How do I get JavaScript to clear the previous onclick element when a user moves on to the next click?

    How to place divs one next to another without floatant?

    How to set a Fill value [closed]

    Clickable dropdowns - How do they work?

    How to put all css files in one file and all javascript files in one file

    How do you target div last-child within another div?

    layout - show the latter coded div at top without absolute positioning

    How to keep an element fixed top within another element?

    How to use body_class to change css according to page hierarchy

    How do I animate this box to have a pop out effect?

    How to change a form's CSS class without affecting FormController.$pristine?

    Div / CSS / ZIndex - how to overlap pictures?

    CSS - How to use “vertical-align : middle” with a table near an image?

    How to emulate window title bar in CSS/HTML

    How to change Image inside of CSS of a usercontrol

    ExtJS - How to style disabled buttons?

    How can I create an addin in Visual Studio to generate javascript, CSS and other code from a settings file

    How do I properly add a scrollbar to a jQuery Mobile popup using iScrollview?

    How to get MetroUI CSS Datepicker value with javascript

    How to dynamically positioning html table by using css properties?

    How can I show a DIV when hovering on a DIV using pure CSS?

    Ruby Command Line: How can I send the CTRL-C command via text in the command line?

    How to render email template in a page?

    How to change the css of a div using the click function on jQuery, but however twice instead of once?

    How to center my a div in a table using CSS?

    How to close a modal box after form submit?

    How to align a table menu to an Banner

    How can I create a responsive web page layout with 'display:inline-block'?

    How to align text and image in xslt with css

    How do I select an element in the dom with an attribute of ct:value?