Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Junior Member
    Join Date
    Aug 2005
    Posts
    11
    Member #
    11024
    I posted this question a while back, but had not luck. Maybe now...

    I have a table, and i'm trying to set a fixed row height. But the row adjusts itself to allow the content to fit.
    How can i have a fixed row height?

    Code:
    <table>
    	<tr><td style="height: 10px; overflow: hidden;">Test Text<br />Test Text</td></tr>
    </table>

  2.  

  3. #2
    Senior Member
    Join Date
    Jul 2005
    Location
    S.Wales, UK
    Posts
    250
    Member #
    10742
    You can't have a fixed row height as such. If the content is bigger than the height then it will force the row to go bigger. Either have a bigger height or smaller content. Height and Width are not standard anymore on tables and some browsers will even ignore then or get the spacing wrong.
    Paul Creedy
    Visit my community site at: www.rhonddacynontaff.com
    My hosting: www.rcthosting.com
    My Content Management product: www.dynamiccontenteditor.com

  4. #3
    Junior Member
    Join Date
    Aug 2005
    Posts
    11
    Member #
    11024
    Ouch. That's nasty.

    Is there any kind of hack to achieve what i want?
    I don't think i've ever come across a problem like this - one that couldn't be solved.

  5. #4
    Senior Member
    Join Date
    Jul 2005
    Location
    S.Wales, UK
    Posts
    250
    Member #
    10742
    I'm not 100% sure what you are trying to do or why.

    You may be able to use a div and css

    Why not just make the height bigger?
    Paul Creedy
    Visit my community site at: www.rhonddacynontaff.com
    My hosting: www.rcthosting.com
    My Content Management product: www.dynamiccontenteditor.com

  6. #5
    Junior Member
    Join Date
    Aug 2005
    Posts
    11
    Member #
    11024
    I'm making a tv guide.
    The height of each cell is really important, because each cell is as tall as a show is long. This way different channel columns timeslot's will line up... etc
    Originally i was using div's, but the code seemed so bloated, and tables were more suited to this type of thing.

  7. #6
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    They are; that is, after all, tabular data. You could try putting a div inside the table and setting an absolute height and overflow: auto; on it using CSS.

  8. #7
    Junior Member
    Join Date
    Aug 2005
    Posts
    11
    Member #
    11024
    Then i have even more code than i did to begin with...

  9. #8
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    So you're going to fill these cells with content to the extent that they expand.

    In your fixed height model how is this meant to be dealt with? Scrollbars in cells, or truncate the content?

    Sean

  10. #9
    Senior Member
    Join Date
    Jul 2005
    Location
    S.Wales, UK
    Posts
    250
    Member #
    10742
    Quote Originally Posted by cowlauncher
    I'm making a tv guide.
    The height of each cell is really important, because each cell is as tall as a show is long. This way different channel columns timeslot's will line up... etc
    Originally i was using div's, but the code seemed so bloated, and tables were more suited to this type of thing.
    In a schedule of some sort, wouldn't it go left to right, rather than top to bottom? Is it the height or the width you are trying to control?

    Whichever way you do it, if the content is bigger than the cell, the cell will probably expand. Why would you want to hide some of the content because it wouldn't be readable.

    If you are trying to do coloured columns/rows then the other way is to use a single pixel spacer image of a fixed colour. Then alter the size of the pixel with the image width/height. Therefore the cell should collapse around the fixed image size.
    Paul Creedy
    Visit my community site at: www.rhonddacynontaff.com
    My hosting: www.rcthosting.com
    My Content Management product: www.dynamiccontenteditor.com

  11. #10
    Junior Member
    Join Date
    Aug 2005
    Posts
    11
    Member #
    11024
    In a schedule of some sort, wouldn't it go left to right, rather than top to bottom?
    Normally they do. Vertical tv guides just make more sense to me.

    Why would you want to hide some of the content because it wouldn't be readable.
    I need to hide it to make sure each cell is the right length. I already truncate the text to make sure it only takes up one line. But sometimes i need to shave off a pixel or two from the height.

    Even with truncated text you still get the idea of which show is on. And if you hover over the cell a div shows up with full info. (which is another problem altogher, trying to make it play nice with ie)


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:42 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com