Solved

I need some help fixing this table width please

Posted on 2009-07-06
6
126 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
ID: 24789291
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
ID: 24789309
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
ID: 24789317
<table style="max-width:350px !important;">
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 11

Author Comment

by:Amanda Watson
ID: 24789926
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
ID: 24790031
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
ID: 24791109
thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

823 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