HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
table rendering probelm
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table
View previous topic :: View next topic  
Author Message
tweakmy



Joined: 16 Feb 2008
Posts: 7

PostPosted: Sat Feb 16, 2008 6:06 am     table rendering probelm Reply with quote

hi there,
can somebody please explain to me how to make a very rigid/fixed column width.

i m having this table like below:

Code:
<table border=1>
<tr>
<td width=200>&nbsp;</td><th colspan=2>name</th>
</tr>
<tr>
<td width=200>time1</td>
<td width=40>a1</td><td width=40>b1</td>
</tr>
<tr>
<td width=200>time2</td>
<td width=40>a2</td><td width=40>b2</td>
</tr>
<tr>
<td width=200>time3</td>
<td width=40>a3</td><td width=40>b3</td>
</tr>


everytime i submit to the same page, the column a1 and b1 became too big(it is at least not 40px)? why? what did i do wrong here?


btw, the table above is within another table.
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8205
Location: Castle Rock CO USA

PostPosted: Sat Feb 16, 2008 6:10 am     Reply with quote



Try using styles
Code:
<table border="1">
   <tr>
      <td style="width: 200px;">&nbsp;</td>
      <td colspan="2">name</td>
   </tr>
   <tr>
      <td style="width: 200px;">time1</td>
      <td style="width: 40px;">a1</td>
      <td style="width: 40px;">b1</td>
   </tr>
   <tr>
      <td style="width: 200px;">time2</td>
      <td style="width: 40px;">a2</td>
      <td style="width: 40px;">b2</td>
   </tr>
   <tr>
      <td style="width: 200px;">time3</td>
      <td style="width: 40px;">a3</td>
      <td style="width: 40px;">b3</td>
   </tr>
</table>
to help control the width. But id the data is more than 40px, the <td> will need to expand.

_________________
Corey
Toll Free Solutions | Mile High Merchant Accounts | Expression Web Blog
tweakmy



Joined: 16 Feb 2008
Posts: 7

PostPosted: Sat Feb 16, 2008 7:17 am     Reply with quote

it does not help. here is other information. i m using a button (along with the table) to submit to itself which mean there is a form exist in the page and also the table as above.

I dont know whether this would affect the table rendering.
tweakmy



Joined: 16 Feb 2008
Posts: 7

PostPosted: Sat Feb 16, 2008 7:28 am     Reply with quote

also, i m not allow to post the php script here
tweakmy



Joined: 16 Feb 2008
Posts: 7

PostPosted: Sat Feb 16, 2008 8:12 am     new finding Reply with quote

tested the same table on the ie
found out that the wording in th has been trimmed off even though the other columns render correctly
tweakmy



Joined: 16 Feb 2008
Posts: 7

PostPosted: Sat Feb 16, 2008 8:21 am     Reply with quote

it seems that th would not wrap the text automatically...why?
madprof



Joined: 26 Jan 2008
Posts: 98

PostPosted: Sat Feb 16, 2008 9:47 am     Reply with quote

Does the <th> have a width set? If not then it won't wrap text because it does not know where to break to a new line. Add a width. Smile
tweakmy



Joined: 16 Feb 2008
Posts: 7

PostPosted: Mon Feb 18, 2008 12:55 am     Reply with quote

ok, i solve the case already. in the hidden input value, there s a line of many "&nbsp;".that is causing the table not to wrap. i just replace ";nbsp" with space.

regards.

some example of no no

<html>

<head>
<style type="text/css">
@import "css/filtergrid.css";
body{ background-image: url(/img/background.jpg); }
</style>
<script language="javascript" type="text/javascript" src="js/tablefilter.js"></script>
<script language="javascript" type="text/javascript" src="js/tablefilter.js"></script>
<script language="javascript" type="text/javascript" src="js/HoldElem.js"></script>
</head>


<body onclick="parent.frames['TITLE'].re_fresh()"
onmousemove="parent.frames['TITLE'].re_fresh()"
onkeypress="parent.frames['TITLE'].re_fresh()">


<form action='form.php' name='filterform' method='get'>
<input type='hidden' name='Page_Number' value=''>
<input type='hidden' name='filtercriteria' value='1,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PS&nbsp;:BFOS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6.6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:SPARE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MV&nbsp;:I&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,A'>
<input type='hidden' name='Table_Type_parameter' value='e_s15_trend,9,15_sec_trending_archive_measured'>
<input type='hidden' name='Start_Time' value='04-02-2008 18:24:30'>
<input type='hidden' name='End_Time' value='12-02-2008 01:45:00'>
</form><form action='csv.php' name='convert_csv' method='post'><input type='hidden' name='get_element' value=''></form><br><div align='center'><h1 font-size='x-large'>Archived View: 15_sec_trending_archive_measured</h1></div><br><br><br><div>
<table border='1'>
<tr><td><br></td><td align='right'><a href='https://192.9.200.114:443/form_pdf.php?Table_Type_parameter=e_s15_trend%2C9%2C15_sec_trending_archive_measured&filtercriteria=1%2C%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BPS%26nbsp%3B%3ABFOS%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B6.6%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3ASPARE%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BMV%26nbsp%3B%3AI%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%2CA&Start_Time=04-02-2008+18%3A24%3A30&End_Time=12-02-2008+01%3A45%3A00'>Save As PDF</a></td><td align='left'><img border='0' src='img/PDF_icon.gif' width='40'></td></tr>
<tr><td width='5%'><br></td><td><table border='1' bgcolor='#ffffff' name='table_1' id='table_1'>
<tr valign='top'><td style='width: 200px;height:40px'>&nbsp</td><td style='width:120; word-wrap:break=word'colspan=2> PS :BFOS 6.6 :SPARE MV :I </td></tr>

<tr><td style='width: 200px'>Date & Time</td><td style='width: 60px'> MV</td><td style='width: 60px'> STATE</td></tr>
<tr valign='top'><td style='width: 200px'>06-02-2008 09.15.30</td><td style='width: 60px'>0</td><td style='width: 60px'>D</td></tr>
<tr valign='top'><td style='width: 200px'>06-02-2008 09.15.45</td><td style='width: 60px'>0</td><td style='width: 60px'>D</td></tr>
<tr valign='top'><td style='width: 200px'>06-02-2008 09.16.00</td><td style='width: 60px'>0</td><td style='width: 60px'>D</td></tr>
.................

</html>
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8205
Location: Castle Rock CO USA

PostPosted: Fri Feb 22, 2008 10:18 am     Reply with quote

Ah sorry, I missed the
Code:
&nbsp;
from your original code.

_________________
Corey
Residential Office Solutions | Mile High Merchant Accounts | Expression Web Blog
billy48



Joined: 28 Feb 2008
Posts: 1

PostPosted: Thu Feb 28, 2008 3:16 pm     Reply with quote

good catch!
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial