0

How to set seperate heights for <td> ? I have table with one rows and 2 cells. In one of them there is more data, so it drags the other cell longer than it should be and that's ugly. I need something that automatically adjusts the cell height according to how much data it consists. How can I achieve this effect ?

4
Contributors
6
Replies
7
Views
5 Years
Discussion Span
Last Post by Martin C++
0

If you look into using CSS it may help, you can use a fairly simple code on each part of the table.
You can simply assign a class to each row / column to control what the style is a width.

The css for this is as follows, assign the class then place this in the style sheet.

.tablesize
{
width: auto;
height: auto;
}

this should solve your problem, just make sure you do the class on each part of the table, such as

<tr>
    <td class="tablesize">&nbsp;</td>
    <td class="tablesize">&nbsp;</td>
  </tr>

if you dont know how to attach a stylesheet, there are numerous tutorials on this.
Thanks,
Adam

0

It did not fix my problem.

Check image in attachment, maybe it helps to understand what I need.

This is what I have. I need the second box to be with exact height of how much data it has inside.

0

Please post code, including CSS, its hard to figure it out without this. Should be able to sort this quicker with the code :)

0

You can create a parent div that contains 2 child divs. The first child div should be floated left, whilst the other floated right. But, you will have to do some fiddling with CSS to make the children divs remain in the parent.

0

I had them in divs before but I decided to go with tables cause it seemed to be more cleaner, but I guess I will switch back to divs cause I cant resize cells. Thanks for help guys!

This topic has been dead for over six months. 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.