[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 7318
  • Last Modified:

Force Table Width and height

Is there a way to FORCE a table to be a certain height and width, regardless of what information is in there ?
0
milkmon123
Asked:
milkmon123
  • 4
  • 2
1 Solution
 
Irwin SantosComputer Integration SpecialistCommented:
<table width="725">
<tr>
<td width="1">
<img src="graphicimage600pixelinheight1pixelinwidth.gif">
</td>
<td>
information goes here
</td>
</tr>
</table>
0
 
Irwin SantosComputer Integration SpecialistCommented:
image info...

graphic image 600 pixel in height 1 pixel in width

interchange 725 for width to whatever width you want

and

create a graphic image (600) in height or whatever you wish
0
 
milkmon123Author Commented:
Hi

What I meant was to contrain it - so if there is too much information, it doesn't make the table higher than it should be....

so, <table width='200' height='250'><tr><td> hello<br><br><br><br>there<br><br><br>hello<br><br></td></tr></table>

... this makes the table height more like 400 - but I want it to be FIXED at 250, so the text just doesn't display past 250 height.

Any ideas ? - I think there is something like 'fixed' or whatever in the style but I can't remember.

Matt
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
milkmon123Author Commented:
it's all gone quiet.....
0
 
klykkenCommented:
You can't set height on your table properties, but you can get around that by adding a div tag inside your td:
CSS:
<style type="text/css">
<!--
table#yourtable div{
      width: 100px;
      height: 100px;
      overflow: hidden;
      border: 1px solid red;}
-->
</style>

HTML:
<table id="yourtable">
      <tr>
            <td>
                  <div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
                  <div>
            </td>
      </tr>
</table>

Good Luck!

-klykken
0
 
milkmon123Author Commented:
Brilliant - thanks !

Matt
0
 
milkmon123Author Commented:
Now I have a problem....

I need to link these two questions together....

I need to use the float:left; style thing with the overflow: hidden; thing -

Basically, I need to display a screen of products - and if the screen is expanded or contracted, the products must arrange themselves....

float:left does this - but the tables aren't always the right height - so this poses a problem.

I want to use float:left, but force the tables to be the same height / width, regardless of info - please help !!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now