Keeping table cells the same height/width

Discussion in 'Web Design and Development' started by MacFan782040, Jan 8, 2008.

  1. MacFan782040 macrumors 6502a

    MacFan782040

    Joined:
    Dec 1, 2003
    Location:
    Scranton, PA
    #1
    Hey guys, hopefully somebody can help me. I'm creating a calendar online using Dreamweaver, using simple tables.

    http://www.kutztownkappasig.com/access/calendar.html

    That's the link. From April on, the tables are perfect. Each cell is the correct height/width, which is the way I want it. However, when I type text into the cells, it automatically re-adjusts in size. I do not want this to happen.

    How can I correct this? Thanks!!
     
  2. MrSmith macrumors 68040

    MrSmith

    Joined:
    Nov 27, 2003
    #2
    Set cellpadding and cellspacing to zero in the table tag. Then set each column height and width. Best to use styles for that.

    td {
    height: 40px;
    width: 40px;
    }

    Hope that makes sense. :)
     
  3. MacFan782040 thread starter macrumors 6502a

    MacFan782040

    Joined:
    Dec 1, 2003
    Location:
    Scranton, PA
    #3
    Thanks for the reply. I think I got the first part about the padding and spacing. I highlighted the entire table (one month) and right clicked onto Tag Editor. Then I set the Padding and Spacing both to 0.

    I got stuck on the next part. I've never really used styles before. Can you help me further? I really appriciate it. Thank you!!!!
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    Add this block of code inside your head tag,

    HTML:
    <style type="text/css" media="all">
    td {
     height: 40px;
     width: 40px;
    }
    </style>
    You can other CSS in there as well, which would allow you to get rid of those font tags among other things. Though you can learn that latter.
     
  5. MrSmith macrumors 68040

    MrSmith

    Joined:
    Nov 27, 2003
    #5
    No prob. :)

    Forget the styles as you're using an editor and it puts the tags in for you in individual cells. The cells don't have a height set according to your source code.

    You have:

    <td width="50"><strong>15</strong></td>

    You want to try tags like this:

    <td width="100" height="100"><strong>7</strong></td>

    BTW, on second thoughts you could add some cellpadding so your contents don't touch the sides. As long as the cells are set big enough it won't increase the size of the cells.

    See where that gets you.
     

Share This Page