Make Cell Not Resizable

Discussion in 'HTML' started by vunet.us@gmail.com, Feb 8, 2007.

  1. Guest

    Hello,
    My table's cell has a 100px width. But when I shrink window, the cell
    size gets smaller and smaller. How can I avoid this? The code is
    below. Thanks you all.

    <html>
    <head>
    <meta http-equiv="content-type" content="text/html;
    charset=iso-8859-1">
    <meta http-equiv="content-language" content="en-us">
    <title>Simple example</title>

    <style type="text/css">
    table.sample {
    border-width: 0px;
    border-spacing: 0px;
    border-collapse: collapse;
    }
    table.sample td {
    width:100px;
    border-width: 1px;
    padding: 1px;
    border-style: inset;
    border-color: gray;
    background-color: white;
    }
    </style>

    </head>
    <body>
    <table class="sample"><tr>
    <td>Content</td><td>Content</td><td>Content</td><td>Content</
    td><td>Content</td><td>Content</td><td>Content</td>
    </tr></table>
    </body>
    </html>
     
    , Feb 8, 2007
    #1
    1. Advertising

  2. Ben C Guest

    On 2007-02-08, <> wrote:
    > Hello,
    > My table's cell has a 100px width. But when I shrink window, the cell
    > size gets smaller and smaller. How can I avoid this? The code is
    > below. Thanks you all.


    Set a width on the whole table instead (about 700px in this case), and
    not on the <td>s.
     
    Ben C, Feb 8, 2007
    #2
    1. Advertising

  3. Guest

    On Feb 8, 4:52 pm, Ben C <> wrote:
    > On 2007-02-08, <> wrote:
    >
    > > Hello,
    > > My table's cell has a 100px width. But when I shrink window, the cell
    > > size gets smaller and smaller. How can I avoid this? The code is
    > > below. Thanks you all.

    >
    > Set a width on the whole table instead (about 700px in this case), and
    > not on the <td>s.


    if i cannot do it, are there any other options? my fix was inserting
    preset width wiv inside of the cell. thanks.
     
    , Feb 8, 2007
    #3
  4. wrote:
    > On Feb 8, 4:52 pm, Ben C <> wrote:
    >> On 2007-02-08, <> wrote:
    >>
    >>> Hello,
    >>> My table's cell has a 100px width. But when I shrink window, the cell
    >>> size gets smaller and smaller. How can I avoid this? The code is
    >>> below. Thanks you all.

    >> Set a width on the whole table instead (about 700px in this case), and
    >> not on the <td>s.

    >
    > if i cannot do it, are there any other options? my fix was inserting
    > preset width wiv inside of the cell. thanks.
    >

    Unfortunately the reason for your trouble is that the table cells are
    behaving like 'table-cell's! They are suppose to do that. Maybe you are
    choosing the wrong element? How about a URL?

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Feb 8, 2007
    #4
  5. dorayme Guest

    In article
    <>,
    wrote:

    > Hello,
    > My table's cell has a 100px width. But when I shrink window, the cell
    > size gets smaller and smaller. How can I avoid this? The code is
    > below. Thanks you all.
    >
    > <html>



    You can count the cells across and multiply the number by the
    width of each cell, add some px for the borders and let this
    guide a min-width setting for a wrapper:

    ..wrapper {min-width: 780px;}

    and in the html

    <div>

    your table code (which has a white space error in it btw)

    </div>

    will do the trick in decent browsers.

    You can avoid this construction altogether as well. It is almost
    invariably better to let the magic of tables do its work, ie. the
    cells to be determined by the content... fluidity and
    intuitively happy wrapping.

    --
    dorayme
     
    dorayme, Feb 8, 2007
    #5
  6. Guest

    On Feb 8, 5:07 pm, "Jonathan N. Little" <> wrote:
    > wrote:
    > > On Feb 8, 4:52 pm, Ben C <> wrote:
    > >> On 2007-02-08, <> wrote:

    >
    > >>> Hello,
    > >>> My table's cell has a 100px width. But when I shrink window, the cell
    > >>> size gets smaller and smaller. How can I avoid this? The code is
    > >>> below. Thanks you all.
    > >> Set a width on the whole table instead (about 700px in this case), and
    > >> not on the <td>s.

    >
    > > if i cannot do it, are there any other options? my fix was inserting
    > > preset width wiv inside of the cell. thanks.

    >
    > Unfortunately the reason for your trouble is that the table cells are
    > behaving like 'table-cell's! They are suppose to do that. Maybe you are
    > choosing the wrong element? How about a URL?
    >
    > --
    > Take care,
    >
    > Jonathan
    > -------------------
    > LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com


    i thought so. i already inserted some other fixed width elements
    inside of the cell to fix my problem. my table itself can have
    different amount of cells, so i could not set a fixed width to table
    element itself.
    thank you for explanation.
     
    , Feb 8, 2007
    #6
  7. Ben C Guest

    On 2007-02-08, <> wrote:
    > On Feb 8, 4:52 pm, Ben C <> wrote:
    >> On 2007-02-08, <> wrote:
    >>
    >> > Hello,
    >> > My table's cell has a 100px width. But when I shrink window, the cell
    >> > size gets smaller and smaller. How can I avoid this? The code is
    >> > below. Thanks you all.

    >>
    >> Set a width on the whole table instead (about 700px in this case), and
    >> not on the <td>s.

    >
    > if i cannot do it, are there any other options? my fix was inserting
    > preset width wiv inside of the cell. thanks.


    That sounds just as good or better (because as you say you don't have to
    know how many cells there are).

    I don't know of any other way, you could experiment perhaps with
    table-layout: fixed.
     
    Ben C, Feb 8, 2007
    #7
  8. BootNic Guest

    > <> wrote:
    > news:
    > Hello,
    > My table's cell has a 100px width. But when I shrink window, the cell
    > size gets smaller and smaller. How can I avoid this? The code is
    > below. Thanks you all.
    >

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    > <html>
    > <head>
    > <meta http-equiv="content-type" content="text/html;
    > charset=iso-8859-1">
    > <meta http-equiv="content-language" content="en-us">
    > <title>Simple example</title>
    >
    > <style type="text/css">
    > table.sample {
    > border-width: 0px;
    > border-spacing: 0px;
    > border-collapse: collapse;

    table-layout:fixed;
    > }
    > table.sample td {
    > width:100px;
    > border-width: 1px;
    > padding: 1px;
    > border-style: inset;
    > border-color: gray;
    > background-color: white;
    > }

    table.sample td:before {
    content: '';
    display: block;
    height: 0;
    margin: 0;
    padding: 0;
    width: 100px;
    }
    > </style>
    >
    > </head>
    > <body>
    > <table class="sample">

    <tbody>
    > <tr>
    > <td>Content</td><td>Content</td><td>Content</td>
    > <td>Content</td><td>Content</td><td>Content</td>
    > <td>Content</td>
    > </tr>

    </tbody>
    > </table>
    > </body>
    > </html>


    --
    BootNic Thursday, February 08, 2007 7:33 PM

    "I fought the Dharma, and the Dharma won."
    *Allen Ginsberg*
     
    BootNic, Feb 9, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thiago Almeida

    Resizable columns on a web datagrid

    Thiago Almeida, Oct 15, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    745
    Thiago Almeida
    Oct 15, 2003
  2. =?Utf-8?B?TWF0dCBIYW1pbHRvbg==?=

    RE: Are datagrids in Windows Application resizable?

    =?Utf-8?B?TWF0dCBIYW1pbHRvbg==?=, Sep 1, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    349
    =?Utf-8?B?Tm9lbCBMYXdhcw==?=
    Sep 2, 2004
  3. =?Utf-8?B?Tm9lbCBMYXdhcw==?=

    RE: Are datagrids in Windows Application resizable?

    =?Utf-8?B?Tm9lbCBMYXdhcw==?=, Sep 5, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    384
    Graeme
    Sep 5, 2004
  4. Replies:
    4
    Views:
    110
  5. Replies:
    2
    Views:
    246
    Thomas 'PointedEars' Lahn
    Aug 5, 2008
Loading...

Share This Page