Formatting html tables

K

K.

Hello!

I have a problem with formatting tables.

I have such code (it is not the exact code I have but I simplified the
example):

<table>
<tr>
<td>
<table style="border: 1px solid black;"> //table 1
<tr>
<td>
test<br>
test
</td>
</tr>
</table>
</td>
<td>
<table style="border: 1px solid black;"> //table2
<tr>
<td>
test<br>
test
</td>
</tr>
</table>
</td>

</tr>
</table>

I know that such code is not so good, but please write me how I can achieve
such thing

I would like both "table1" and "table2" to have the same equal heights. I
would like to
build such "table1" and "table2" which will have equal heights i.e.
if "table1" will have 3 "records" of "test" word separated by <br> tag, the
height of "table2" should fit to "table1"
if "table2" will have 3 "records" of "test" word separated by <br> tag, the
height of "table1" should fit to "table2".
I also add that both "table1" and "table2" have border lines rounded by the
whole <table>

Please help me
Every help really apprieciated
M.
 
J

Jukka K. Korpela

Scripsit K.:
I have a problem with formatting tables.

Rule of thumb: You are allowed to use a simple layout table, with no
nested tables, and with no pixel-width settings, if you find this
simpler to do than CSS formatting. Otherwise, stay away from using
tables for layout, as opposite to using them for tabular data
structures.
I have such code (it is not the exact code I have but I simplified the
example):

You should have posted the exact URL. You have now isolated the
important part away from your snippet, and you are not helping us to
help you to find a better approach than nested tables.
I know that such code is not so good, but please write me how I can
achieve such thing

Why would we help you to do something that you (and we) know to be
wrong?
 
D

dorayme

"K. said:
Hello!

I have a problem with formatting tables.

I have such code (it is not the exact code I have but I simplified the
example):

<table>
<tr>
<td>
<table style="border: 1px solid black;"> //table 1
I know that such code is not so good, but please write me how I can achieve
such thing

I would like both "table1" and "table2" to have the same equal heights. I
would like to
build such "table1" and "table2" which will have equal heights

Please help me as i am standing on the edge of a cliff and
if I don't get the solution in 30 secs I will jump and
it will be all your fault's.

In that case, you better look at:

<http://dorayme.890m.com/alt/equiTables.html>
 
R

Roy A.

Hello!

I have a problem with formatting tables.

I have such code (it is not the exact code I have but I simplified the
example):

<table>
    <tr>
        <td>
            <table style="border: 1px solid black;">  //table 1
                <tr>
                    <td>
                        test<br>
                        test
                    </td>
                </tr>
            </table>
        </td>
        <td>
            <table style="border: 1px solid black;">   //table2
                <tr>
                    <td>
                        test<br>
                        test
                    </td>
                </tr>
            </table>
        </td>

    </tr>
</table>

I know that such code is not so good, but please write me how I can achieve
such thing

That code is not good. Just shift your last table with a div element.
And use CSS to style the rest, like table cells.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top