html tables: specifying dimentions

taekwondokid42

New Member
Messages
268
Reaction score
0
Points
0
I can specify the width, but I'm having trouble telling the server how long to make my tables. How can I do this?


edit: I've realized that I can make the table longer, but how do I make the table shorter than the default?

ie: I cannot make the height less than 50, but I want it to be 35.
 
Last edited:

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
Table length is automatically parsed corresponding to how many rows you have in your table.
 

freecrm

New Member
Messages
629
Reaction score
0
Points
0
Generally, tables by default will fit the contents.

i.e., if you have a table with no settings, each cell will default to fit the text size.

This means that a table with 4 rows for instance but nothing in any of the cells will have a height proportional to 4 x the text height + the default padding.

You can over-ride these in the css.

I don't think the table css itself makes much difference but if you alter the cell heights, it should do what you want.

i.e.

td {
max-height: 35px;
margin: whatever;
padding: whatever;
overflow: auto;
}

Alternatively, you may want to just change the text size for each cell which will have a similar effect.

If you want the whole table to be shorter, you'll have to put it into another container and then specify a max-height for that container - with overflow: auto

Just be wary of different browsers though - especially IE6!

Not sure what you mean by "telling the server how long to make my tables" - this isn't a server instruction, unless you wanted to make the css definitions into say php variables???
 
Top