Solved

I need some help fixing this table width please

Posted on 2009-07-06
6
124 Views
Last Modified: 2012-05-07
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

0
Comment
Question by:Amanda Watson
6 Comments
 
LVL 8

Expert Comment

by:lharrispv
Comment Utility
the code you have should do the trick.  If not give me more details of what is making it grow and I will look.
0
 
LVL 14

Expert Comment

by:amichaell
Comment Utility
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).
0
 
LVL 2

Expert Comment

by:grvulture
Comment Utility
<table style="max-width:350px !important;">
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 11

Author Comment

by:Amanda Watson
Comment Utility
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">
?
0
 
LVL 2

Accepted Solution

by:
grvulture earned 500 total points
Comment Utility
first choice would be right.

both choices should NOT let your table grow beyond 350pixels, even if you have a width statement of 719
0
 
LVL 11

Author Comment

by:Amanda Watson
Comment Utility
thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now