0

Hi there,

i woul love to make a table whitout using the TABLE tag but the DIV...

For Example the same one with div:

    <table id="body" cellpadding="0">


            <tr style="height: 30px">
                <td>
                    TEXT
                </td>
                <td>
                    TEXT
                </td>
                <td>
                    TEXT
                </td>
            </tr>
            <tr style="height: 30px">
                <td>
                    TEXT
                </td>
                <td>
                    TEXT
                </td>
                <td>
                    TEXT
                </td>
            </tr>
            </table>
3
Contributors
5
Replies
32
Views
3 Years
Discussion Span
Last Post by grafic.web
1

Something like this should work:

<!DOCTYPE html>
<html>
    <head>
        <title>Tabless</title>
        <style type="text/css">
            *{margin:0;padding:0;}
            .table { display:table; margin:50px auto; width:960px; position:relative; }
            .tr { display:table-row; margin:10px 0; }
            .td { display:table-cell; height:30px; }
            .strong {font-weight:bold;}
        </style>
    </head>
    <body>

        <div class="table">
            <ul class="tr strong">
                <li class="td">TEXT</li>
                <li class="td">TEXT</li>
                <li class="td">TEXT</li>
            </ul>
            <ul class="tr">
                <li class="td">TEXT</li>
                <li class="td">TEXT</li>
                <li class="td">TEXT</li>
            </ul>
        </div>

    </body>
</html>

Reference: https://developer.mozilla.org/en-US/docs/Web/CSS/display

Bye!

Edited by cereal

0

Hi,

if it does not work give us some more information: How it does not work? What result do you expect? What kind of problem you get? And possibly show your code. My example works fine for me in Google Chrome, Mozilla Firefox and Opera. Bye!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.