Mount table with div

Asked

Viewed 377 times

1

I have the following table in HTML

 <table style="width: 100%">
    <tr>
        <td style="width: 50px">
            <img src="https://s32.postimg.org/x1llms2ph/caixa_padrao.png">
        </td>
        <td>
            <table>
            <tr>
                <td>Texto 1</td>
            </tr>
            <tr>
                <td>Texto 2</td>
            </tr>
            <tr>
                <td>Texto 3</td>
            </tr>
        </table>
        </td>
    </tr>
    </table>

Can someone help me mount one just like it, but in DIV and CSS

1 answer

4


It would look something like this:

            .container{display: block;}
            .container img{float: left;margin-top: 7px;margin-right: 10px;}
            .container p{margin: 5px 0px;}
        <div class="container">
            <img src="https://s32.postimg.org/x1llms2ph/caixa_padrao.png">
            <p>Texto 1</p>
            <p>Texto 2</p>
            <p>Texto 3</p>
        </div>

  • OK thanks, that’s what I wanted

  • how do I get the image to the top? because the text1 is at the top, the image is not

  • 1

    Just take the margin. It would look like this : . container img{float: left;margin-top: 0px;margin-right: 10px;}

  • Okay, it worked out here vlw

Browser other questions tagged

You are not signed in. Login or sign up in order to post.