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 ?
LVL 1
milkmon123Asked:
Who is Participating?
 
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
 
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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
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
 
milkmon123Author Commented:
it's all gone quiet.....
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.