Link to home
Start Free TrialLog in
Avatar of Amanda Watson
Amanda WatsonFlag for Australia

asked on

I need some help fixing this table width please

Hi There,
I have a table that fits beautifully in my CMS webpage.
When the client updates this table, I do not want the table to extend beyond 719px.
How can I alter this code below to ensure that no matter what the table will stay at that width.
Ideally I would like the height to remain the same too, but I am thinking this could be impossible?
I tried this:
<table style="max-width:350px;">
but I am not sure I added it correctly in the below code, because when I went to edit the table, the text stretched the table width
?
<table border="1" width="719" height="328"><tbody><tr><td colspan="5"><p> <strong><font face="arial,helvetica,sans-serif">FIXTURES AND RESULTS - <em>Northern Rivers Village Information</em></font></strong></p></td></tr><tr align="center" valign="middle"><td><p><strong><br /> </strong></p></td><td><p><strong> DATE</strong></p></td><td><p><strong> MATCH</strong></p></td><td><p><strong> VENUE</strong></p></td><td><p><strong> RESULT<br /></strong></p></td></tr><tr><td> 1</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 2</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 3</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 4</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 5</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 6</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 7</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 8</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 9</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 10</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 11</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 12</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 13</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 14</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 15</td><td> </td><td> </td><td> </td><td> </td></tr><tr><td> 16</td><td> </td><td> </td><td> </td><td> </td></tr></tbody></table><p>&nbsp;</p>

Open in new window

Avatar of lharrispv
lharrispv
Flag of United States of America image

the code you have should do the trick.  If not give me more details of what is making it grow and I will look.
I'm not HTML guru, so take this with a grain of salt...

As far as I know specifying the width as you've done sets the absolute width of the table in pixels (or percentage if you choose).  Since you specified 719 the table should not grow beyond that width.  

There is a height command available within the <td> element.  <td height="">.  Works the same as width (pixels or percentage).
Avatar of Chris Michaelides
<table style="max-width:350px !important;">
Avatar of Amanda Watson

ASKER

hi grvulture where do I add that?
Like this?

<table style="max-width:350px !important;" border="1" width="719" height="328">

or
<table style="max-width:350px !important;"> <table border="1" width="719" height="328">
?
ASKER CERTIFIED SOLUTION
Avatar of Chris Michaelides
Chris Michaelides
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks