SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict smittenbite's Avatar
    Join Date
    Jul 2005
    Location
    Friendswood
    Posts
    397
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    make all table cells the same size?

    how can i make all table cells the same size? one column of cells is smaller than the other no matter what i do, but all the cells have the same height. how can i make them all have the same width (this is only a 4x4). ? any tips are appreciated
    nothing.

  2. #2
    SitePoint Addict smittenbite's Avatar
    Join Date
    Jul 2005
    Location
    Friendswood
    Posts
    397
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i got it by using 50% width on the first cell.
    nothing.

  3. #3
    SitePoint Addict smittenbite's Avatar
    Join Date
    Jul 2005
    Location
    Friendswood
    Posts
    397
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oops, now theyre not all the same size height wise. i tried to do the same thing by putting height at the beginning of each row. but this works only if theres nothing inside the table. whenever i put something more than 1 line in it, the row height increases but it seems like its doing it for no reason. the space between the words and the top and bottom of the cell is huge - how can i eliminate this space?

    this is all the css i have for the table:

    [css]
    table {
    border: 1px solid black;
    width: 6.9in;
    height: 9in;
    border-style: dashed;

    }

    [/css]
    nothing.

  4. #4
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,095
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Hello,

    How does this suit?
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    table {
    	height: 400px;
    	width: 400px;
    	margin: 0; padding: 0;
    	border-collapse: collapse;
    }
    td { 
    	border: 1px solid #CC3;
    	border-spacing: 0;
    	height: 100px;
    	width: 100px;
    	margin: 0; padding: 0;
    }
    </style>
    </head>
    
    <body>
    <table>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    </body>
    </html>

  5. #5
    SitePoint Addict smittenbite's Avatar
    Join Date
    Jul 2005
    Location
    Friendswood
    Posts
    397
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes that worked perfectly! thank you mark =)
    nothing.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •