Fixed Cell Height


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Fixed Cell Height

Hybrid View

  1. #1
    Alice Claussen Guest

    Fixed Cell Height


    I have this html page, with a table on it.
    Everytime the text on one of the cells gets too long, another cell's height
    increases. This second cell has nothing to do with the first one. I want
    it to have a fixed height.
    Check out the code...

    <table border='0' cellspacing='0' cellpadding='0' width='773' height='1'>
    <tr>
    <td height="12" width="158"></td> <!--the cell which height increases -->
    <td width='611' valign=top height="1" rowspan="4">

    <table border="0" width="610" cellspacing="0" cellpadding="0" height="1">
    <tr>
    <td width="610" height="1" valign="top">
    <table border="0" cellspacing="0" width="100%" height="327">
    <tr>
    <td width="78%" valign="top" height="325">
    Here goes the text. If it gets too long, the problem occurs
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>

    </tr>
    <tr>
    <td width='158' valign=top height="222">
    Here goes some menu building code...
    </td></tr>
    <tr>
    <td width='158' valign=top height="452">
    </td>
    </tr>
    </table>

    Please help me, I'm new at HTML and this problem is destroying my page's
    design.
    Thank you very much
    Alice Claussen

  2. #2
    Veign Guest

    Re: Fixed Cell Height

    If both <TD> tags are located within the same <TR> then no. They will be
    the same height.

    On method for allowing one Data cell to be greater the another Data cell
    contained within the same row is to provided a second row and allow one Data
    Cell to span that row;

    Try This code:

    <TABLE border=1>
    <TR>
    <TD Height=50 RowSpan=2>This is allowed to fit into 100px height</TD>
    <TD>This is first 50px</TD>
    </TR>
    <TR>
    <TD Height=50>This is second 50px</TD>
    </TR>
    </TABLE>

    Let me know if I missed the mark with your question

    HTH
    Chris

    "Alice Claussen" <wilice@ig.com.br> wrote in message
    news:3bbca530$1@news.devx.com...
    >
    > I have this html page, with a table on it.
    > Everytime the text on one of the cells gets too long, another cell's

    height
    > increases. This second cell has nothing to do with the first one. I want
    > it to have a fixed height.
    > Check out the code...
    >
    > <table border='0' cellspacing='0' cellpadding='0' width='773' height='1'>
    > <tr>
    > <td height="12" width="158"></td> <!--the cell which height increases -->
    > <td width='611' valign=top height="1" rowspan="4">
    >
    > <table border="0" width="610" cellspacing="0" cellpadding="0" height="1">
    > <tr>
    > <td width="610" height="1" valign="top">
    > <table border="0" cellspacing="0" width="100%" height="327">
    > <tr>
    > <td width="78%" valign="top" height="325">
    > Here goes the text. If it gets too long, the problem occurs
    > </td>
    > </tr>
    > </table>
    > </td>
    > </tr>
    > </table>
    >
    > </tr>
    > <tr>
    > <td width='158' valign=top height="222">
    > Here goes some menu building code...
    > </td></tr>
    > <tr>
    > <td width='158' valign=top height="452">
    > </td>
    > </tr>
    > </table>
    >
    > Please help me, I'm new at HTML and this problem is destroying my page's
    > design.
    > Thank you very much
    > Alice Claussen




  3. #3
    Alice Claussen Guest

    Re: Fixed Cell Height


    Here's what's going on. Cell B is rowspan=4, so it can be bigger then cell
    A. Till here, it works fine. Cell B receives information from a database.

    If cell B's data fits it's predefined height it works fine, but if cell B's
    height needs to get bigger to fit a bigger amount of data, then cell A grows
    too. I don't understand because if cell A was already smaller then B, why
    does it grow when B grows?

    -------------------------------------
    | cell A | |
    --------------- |
    | |
    | |
    | cell B |
    | |
    | |
    | |
    -----------------------

    Thank you very much for your attention, hope you can help me.
    Thanx

    Alice Claussen

    "Veign" <NOSPAMinveign@veign.com> wrote:
    >If both <TD> tags are located within the same <TR> then no. They will be
    >the same height.
    >
    >On method for allowing one Data cell to be greater the another Data cell
    >contained within the same row is to provided a second row and allow one

    Data
    >Cell to span that row;
    >
    >Try This code:
    >
    ><TABLE border=1>
    ><TR>
    > <TD Height=50 RowSpan=2>This is allowed to fit into 100px height</TD>
    > <TD>This is first 50px</TD>
    ></TR>
    ><TR>
    > <TD Height=50>This is second 50px</TD>
    ></TR>
    ></TABLE>
    >
    >Let me know if I missed the mark with your question
    >
    >HTH
    >Chris
    >
    >"Alice Claussen" <wilice@ig.com.br> wrote in message
    >news:3bbca530$1@news.devx.com...
    >>
    >> I have this html page, with a table on it.
    >> Everytime the text on one of the cells gets too long, another cell's

    >height
    >> increases. This second cell has nothing to do with the first one. I want
    >> it to have a fixed height.
    >> Check out the code...
    >>
    >> <table border='0' cellspacing='0' cellpadding='0' width='773' height='1'>
    >> <tr>
    >> <td height="12" width="158"></td> <!--the cell which height increases

    -->
    >> <td width='611' valign=top height="1" rowspan="4">
    >>
    >> <table border="0" width="610" cellspacing="0" cellpadding="0" height="1">
    >> <tr>
    >> <td width="610" height="1" valign="top">
    >> <table border="0" cellspacing="0" width="100%" height="327">
    >> <tr>
    >> <td width="78%" valign="top" height="325">
    >> Here goes the text. If it gets too long, the problem occurs
    >> </td>
    >> </tr>
    >> </table>
    >> </td>
    >> </tr>
    >> </table>
    >>
    >> </tr>
    >> <tr>
    >> <td width='158' valign=top height="222">
    >> Here goes some menu building code...
    >> </td></tr>
    >> <tr>
    >> <td width='158' valign=top height="452">
    >> </td>
    >> </tr>
    >> </table>
    >>
    >> Please help me, I'm new at HTML and this problem is destroying my page's
    >> design.
    >> Thank you very much
    >> Alice Claussen

    >
    >



  4. #4
    Veign Guest

    Re: Fixed Cell Height

    This is some code I put together that will hopefully solve your problem:

    <TABLE width=740 border=1>
    <TR>
    <!-- Start Menu -->
    <TD valign=top>
    <TABLE width=158 border=1>
    <TR><TD height=12>&nbsp</TD></TR>
    <TR>
    <TD height=80>My Menu Items - Fixed Height</TD>
    </TR>
    <TR><TD>Floating Space</TD></TR>
    </TABLE>

    </TD>
    <!-- End Menu -->

    <!-- Start Data -->
    <TD valign=top>
    <TABLE width=582 border=1>
    <TR>
    <TD>My Data</TD>
    </TR>
    </TABLE>

    </TD>
    <!-- End Data -->
    </TR>
    </TABLE>


    I left the Borders 'ON' so you can see the layout of the table. This
    seperates the Menu section from the Data section and lets you control each
    separately...

    Let me know if this works for you..

    Chris

    "Alice Claussen" <wilice@ig.com.br> wrote in message
    news:3bbdb869$1@news.devx.com...
    >
    > Here's what's going on. Cell B is rowspan=4, so it can be bigger then cell
    > A. Till here, it works fine. Cell B receives information from a database.
    >
    > If cell B's data fits it's predefined height it works fine, but if cell

    B's
    > height needs to get bigger to fit a bigger amount of data, then cell A

    grows
    > too. I don't understand because if cell A was already smaller then B, why
    > does it grow when B grows?
    >
    > -------------------------------------
    > | cell A | |
    > --------------- |
    > | |
    > | |
    > | cell B |
    > | |
    > | |
    > | |
    > -----------------------
    >
    > Thank you very much for your attention, hope you can help me.
    > Thanx
    >
    > Alice Claussen
    >
    > "Veign" <NOSPAMinveign@veign.com> wrote:
    > >If both <TD> tags are located within the same <TR> then no. They will be
    > >the same height.
    > >
    > >On method for allowing one Data cell to be greater the another Data cell
    > >contained within the same row is to provided a second row and allow one

    > Data
    > >Cell to span that row;
    > >
    > >Try This code:
    > >
    > ><TABLE border=1>
    > ><TR>
    > > <TD Height=50 RowSpan=2>This is allowed to fit into 100px height</TD>
    > > <TD>This is first 50px</TD>
    > ></TR>
    > ><TR>
    > > <TD Height=50>This is second 50px</TD>
    > ></TR>
    > ></TABLE>
    > >
    > >Let me know if I missed the mark with your question
    > >
    > >HTH
    > >Chris
    > >
    > >"Alice Claussen" <wilice@ig.com.br> wrote in message
    > >news:3bbca530$1@news.devx.com...
    > >>
    > >> I have this html page, with a table on it.
    > >> Everytime the text on one of the cells gets too long, another cell's

    > >height
    > >> increases. This second cell has nothing to do with the first one. I

    want
    > >> it to have a fixed height.
    > >> Check out the code...
    > >>
    > >> <table border='0' cellspacing='0' cellpadding='0' width='773'

    height='1'>
    > >> <tr>
    > >> <td height="12" width="158"></td> <!--the cell which height increases

    > -->
    > >> <td width='611' valign=top height="1" rowspan="4">
    > >>
    > >> <table border="0" width="610" cellspacing="0" cellpadding="0"

    height="1">
    > >> <tr>
    > >> <td width="610" height="1" valign="top">
    > >> <table border="0" cellspacing="0" width="100%" height="327">
    > >> <tr>
    > >> <td width="78%" valign="top" height="325">
    > >> Here goes the text. If it gets too long, the problem

    occurs
    > >> </td>
    > >> </tr>
    > >> </table>
    > >> </td>
    > >> </tr>
    > >> </table>
    > >>
    > >> </tr>
    > >> <tr>
    > >> <td width='158' valign=top height="222">
    > >> Here goes some menu building code...
    > >> </td></tr>
    > >> <tr>
    > >> <td width='158' valign=top height="452">
    > >> </td>
    > >> </tr>
    > >> </table>
    > >>
    > >> Please help me, I'm new at HTML and this problem is destroying my

    page's
    > >> design.
    > >> Thank you very much
    > >> Alice Claussen

    > >
    > >

    >




  5. #5
    Alice Claussen Guest

    Re: Fixed Cell Height


    Thank you... it works perfectly..
    You helped me a lot... thanx
    Alice Claussen

    "Veign" <NOSPAMinveign@veign.com> wrote:
    >This is some code I put together that will hopefully solve your problem:
    >
    ><TABLE width=740 border=1>
    > <TR>
    > <!-- Start Menu -->
    > <TD valign=top>
    > <TABLE width=158 border=1>
    > <TR><TD height=12>*</TD></TR>
    > <TR>
    > <TD height=80>My Menu Items - Fixed Height</TD>
    > </TR>
    > <TR><TD>Floating Space</TD></TR>
    > </TABLE>
    >
    > </TD>
    > <!-- End Menu -->
    >
    > <!-- Start Data -->
    > <TD valign=top>
    > <TABLE width=582 border=1>
    > <TR>
    > <TD>My Data</TD>
    > </TR>
    > </TABLE>
    >
    > </TD>
    > <!-- End Data -->
    > </TR>
    ></TABLE>
    >
    >
    >I left the Borders 'ON' so you can see the layout of the table. This
    >seperates the Menu section from the Data section and lets you control each
    >separately...
    >
    >Let me know if this works for you..
    >
    >Chris
    >
    >"Alice Claussen" <wilice@ig.com.br> wrote in message
    >news:3bbdb869$1@news.devx.com...
    >>
    >> Here's what's going on. Cell B is rowspan=4, so it can be bigger then

    cell
    >> A. Till here, it works fine. Cell B receives information from a database.
    >>
    >> If cell B's data fits it's predefined height it works fine, but if cell

    >B's
    >> height needs to get bigger to fit a bigger amount of data, then cell A

    >grows
    >> too. I don't understand because if cell A was already smaller then B,

    why
    >> does it grow when B grows?
    >>
    >> -------------------------------------
    >> | cell A | |
    >> --------------- |
    >> | |
    >> | |
    >> | cell B |
    >> | |
    >> | |
    >> | |
    >> -----------------------
    >>
    >> Thank you very much for your attention, hope you can help me.
    >> Thanx
    >>
    >> Alice Claussen
    >>
    >> "Veign" <NOSPAMinveign@veign.com> wrote:
    >> >If both <TD> tags are located within the same <TR> then no. They will

    be
    >> >the same height.
    >> >
    >> >On method for allowing one Data cell to be greater the another Data cell
    >> >contained within the same row is to provided a second row and allow one

    >> Data
    >> >Cell to span that row;
    >> >
    >> >Try This code:
    >> >
    >> ><TABLE border=1>
    >> ><TR>
    >> > <TD Height=50 RowSpan=2>This is allowed to fit into 100px height</TD>
    >> > <TD>This is first 50px</TD>
    >> ></TR>
    >> ><TR>
    >> > <TD Height=50>This is second 50px</TD>
    >> ></TR>
    >> ></TABLE>
    >> >
    >> >Let me know if I missed the mark with your question
    >> >
    >> >HTH
    >> >Chris
    >> >
    >> >"Alice Claussen" <wilice@ig.com.br> wrote in message
    >> >news:3bbca530$1@news.devx.com...
    >> >>
    >> >> I have this html page, with a table on it.
    >> >> Everytime the text on one of the cells gets too long, another cell's
    >> >height
    >> >> increases. This second cell has nothing to do with the first one. I

    >want
    >> >> it to have a fixed height.
    >> >> Check out the code...
    >> >>
    >> >> <table border='0' cellspacing='0' cellpadding='0' width='773'

    >height='1'>
    >> >> <tr>
    >> >> <td height="12" width="158"></td> <!--the cell which height increases

    >> -->
    >> >> <td width='611' valign=top height="1" rowspan="4">
    >> >>
    >> >> <table border="0" width="610" cellspacing="0" cellpadding="0"

    >height="1">
    >> >> <tr>
    >> >> <td width="610" height="1" valign="top">
    >> >> <table border="0" cellspacing="0" width="100%" height="327">
    >> >> <tr>
    >> >> <td width="78%" valign="top" height="325">
    >> >> Here goes the text. If it gets too long, the problem

    >occurs
    >> >> </td>
    >> >> </tr>
    >> >> </table>
    >> >> </td>
    >> >> </tr>
    >> >> </table>
    >> >>
    >> >> </tr>
    >> >> <tr>
    >> >> <td width='158' valign=top height="222">
    >> >> Here goes some menu building code...
    >> >> </td></tr>
    >> >> <tr>
    >> >> <td width='158' valign=top height="452">
    >> >> </td>
    >> >> </tr>
    >> >> </table>
    >> >>
    >> >> Please help me, I'm new at HTML and this problem is destroying my

    >page's
    >> >> design.
    >> >> Thank you very much
    >> >> Alice Claussen
    >> >
    >> >

    >>

    >
    >



  6. #6
    Veign Guest

    Re: Fixed Cell Height

    No Problem...
    "Alice Claussen" <wilice@ig.com.br> wrote in message
    news:3bbdee57$1@news.devx.com...
    >
    > Thank you... it works perfectly..
    > You helped me a lot... thanx
    > Alice Claussen
    >
    > "Veign" <NOSPAMinveign@veign.com> wrote:
    > >This is some code I put together that will hopefully solve your problem:
    > >
    > ><TABLE width=740 border=1>
    > > <TR>
    > > <!-- Start Menu -->
    > > <TD valign=top>
    > > <TABLE width=158 border=1>
    > > <TR><TD height=12> </TD></TR>
    > > <TR>
    > > <TD height=80>My Menu Items - Fixed Height</TD>
    > > </TR>
    > > <TR><TD>Floating Space</TD></TR>
    > > </TABLE>
    > >
    > > </TD>
    > > <!-- End Menu -->
    > >
    > > <!-- Start Data -->
    > > <TD valign=top>
    > > <TABLE width=582 border=1>
    > > <TR>
    > > <TD>My Data</TD>
    > > </TR>
    > > </TABLE>
    > >
    > > </TD>
    > > <!-- End Data -->
    > > </TR>
    > ></TABLE>
    > >
    > >
    > >I left the Borders 'ON' so you can see the layout of the table. This
    > >seperates the Menu section from the Data section and lets you control

    each
    > >separately...
    > >
    > >Let me know if this works for you..
    > >
    > >Chris
    > >
    > >"Alice Claussen" <wilice@ig.com.br> wrote in message
    > >news:3bbdb869$1@news.devx.com...
    > >>
    > >> Here's what's going on. Cell B is rowspan=4, so it can be bigger then

    > cell
    > >> A. Till here, it works fine. Cell B receives information from a

    database.
    > >>
    > >> If cell B's data fits it's predefined height it works fine, but if cell

    > >B's
    > >> height needs to get bigger to fit a bigger amount of data, then cell A

    > >grows
    > >> too. I don't understand because if cell A was already smaller then B,

    > why
    > >> does it grow when B grows?
    > >>
    > >> -------------------------------------
    > >> | cell A | |
    > >> --------------- |
    > >> | |
    > >> | |
    > >> | cell B |
    > >> | |
    > >> | |
    > >> | |
    > >> -----------------------
    > >>
    > >> Thank you very much for your attention, hope you can help me.
    > >> Thanx
    > >>
    > >> Alice Claussen
    > >>
    > >> "Veign" <NOSPAMinveign@veign.com> wrote:
    > >> >If both <TD> tags are located within the same <TR> then no. They will

    > be
    > >> >the same height.
    > >> >
    > >> >On method for allowing one Data cell to be greater the another Data

    cell
    > >> >contained within the same row is to provided a second row and allow

    one
    > >> Data
    > >> >Cell to span that row;
    > >> >
    > >> >Try This code:
    > >> >
    > >> ><TABLE border=1>
    > >> ><TR>
    > >> > <TD Height=50 RowSpan=2>This is allowed to fit into 100px

    height</TD>
    > >> > <TD>This is first 50px</TD>
    > >> ></TR>
    > >> ><TR>
    > >> > <TD Height=50>This is second 50px</TD>
    > >> ></TR>
    > >> ></TABLE>
    > >> >
    > >> >Let me know if I missed the mark with your question
    > >> >
    > >> >HTH
    > >> >Chris
    > >> >
    > >> >"Alice Claussen" <wilice@ig.com.br> wrote in message
    > >> >news:3bbca530$1@news.devx.com...
    > >> >>
    > >> >> I have this html page, with a table on it.
    > >> >> Everytime the text on one of the cells gets too long, another cell's
    > >> >height
    > >> >> increases. This second cell has nothing to do with the first one. I

    > >want
    > >> >> it to have a fixed height.
    > >> >> Check out the code...
    > >> >>
    > >> >> <table border='0' cellspacing='0' cellpadding='0' width='773'

    > >height='1'>
    > >> >> <tr>
    > >> >> <td height="12" width="158"></td> <!--the cell which height

    increases
    > >> -->
    > >> >> <td width='611' valign=top height="1" rowspan="4">
    > >> >>
    > >> >> <table border="0" width="610" cellspacing="0" cellpadding="0"

    > >height="1">
    > >> >> <tr>
    > >> >> <td width="610" height="1" valign="top">
    > >> >> <table border="0" cellspacing="0" width="100%" height="327">
    > >> >> <tr>
    > >> >> <td width="78%" valign="top" height="325">
    > >> >> Here goes the text. If it gets too long, the problem

    > >occurs
    > >> >> </td>
    > >> >> </tr>
    > >> >> </table>
    > >> >> </td>
    > >> >> </tr>
    > >> >> </table>
    > >> >>
    > >> >> </tr>
    > >> >> <tr>
    > >> >> <td width='158' valign=top height="222">
    > >> >> Here goes some menu building code...
    > >> >> </td></tr>
    > >> >> <tr>
    > >> >> <td width='158' valign=top height="452">
    > >> >> </td>
    > >> >> </tr>
    > >> >> </table>
    > >> >>
    > >> >> Please help me, I'm new at HTML and this problem is destroying my

    > >page's
    > >> >> design.
    > >> >> Thank you very much
    > >> >> Alice Claussen
    > >> >
    > >> >
    > >>

    > >
    > >

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center