Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Make Cell Not Resizable

Reply
Thread Tools

Make Cell Not Resizable

 
 
vunet.us@gmail.com
Guest
Posts: n/a
 
      02-08-2007
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>

 
Reply With Quote
 
 
 
 
Ben C
Guest
Posts: n/a
 
      02-08-2007
On 2007-02-08, http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
 
vunet.us@gmail.com
Guest
Posts: n/a
 
      02-08-2007
On Feb 8, 4:52 pm, Ben C <(E-Mail Removed)> wrote:
> On 2007-02-08, (E-Mail Removed) <(E-Mail Removed)> 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.

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      02-08-2007
(E-Mail Removed) wrote:
> On Feb 8, 4:52 pm, Ben C <(E-Mail Removed)> wrote:
>> On 2007-02-08, (E-Mail Removed) <(E-Mail Removed)> 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
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      02-08-2007
In article
<(E-Mail Removed) .com>,
(E-Mail Removed) 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
 
Reply With Quote
 
vunet.us@gmail.com
Guest
Posts: n/a
 
      02-08-2007
On Feb 8, 5:07 pm, "Jonathan N. Little" <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > On Feb 8, 4:52 pm, Ben C <(E-Mail Removed)> wrote:
> >> On 2007-02-08, (E-Mail Removed) <(E-Mail Removed)> 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.

 
Reply With Quote
 
Ben C
Guest
Posts: n/a
 
      02-08-2007
On 2007-02-08, (E-Mail Removed) <(E-Mail Removed)> wrote:
> On Feb 8, 4:52 pm, Ben C <(E-Mail Removed)> wrote:
>> On 2007-02-08, (E-Mail Removed) <(E-Mail Removed)> 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.
 
Reply With Quote
 
BootNic
Guest
Posts: n/a
 
      02-09-2007
> (E-Mail Removed) <(E-Mail Removed)> wrote:
> news: (E-Mail Removed). com
> 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*

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cell's offsetHeight not equal to cell's height?? firefox & IE laszlokenez@gmail.com Javascript 2 08-05-2008 10:44 PM
How can I make a window Resizable? sam.s.kong@gmail.com Javascript 4 01-05-2006 05:47 PM
RE: Are datagrids in Windows Application resizable? =?Utf-8?B?Tm9lbCBMYXdhcw==?= ASP .Net 1 09-05-2004 09:19 AM
RE: Are datagrids in Windows Application resizable? =?Utf-8?B?TWF0dCBIYW1pbHRvbg==?= ASP .Net 1 09-01-2004 11:51 PM
Resizable columns on a web datagrid Thiago Almeida ASP .Net 0 10-14-2003 11:59 PM



Advertisments