html tables: specifying dimentions

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by taekwondokid42, Feb 22, 2009.

  1. taekwondokid42

    taekwondokid42 New Member

    Messages:
    268
    Likes Received:
    0
    Trophy 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: Feb 22, 2009
  2. leafypiggy

    leafypiggy Manager of Pens and Office Supplies Staff Member

    Messages:
    3,819
    Likes Received:
    163
    Trophy Points:
    63
    Table length is automatically parsed corresponding to how many rows you have in your table.
     
  3. freecrm

    freecrm New Member

    Messages:
    629
    Likes Received:
    0
    Trophy 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???
     

Share This Page