| View previous topic :: View next topic |
| Author |
Message |
tweakmy
Joined: 16 Feb 2008 Posts: 7
|
Posted: Sat Feb 16, 2008 6:06 am table rendering probelm |
|
|
|
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> </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

Joined: 15 May 2004 Posts: 8154 Location: Castle Rock CO USA
|
Posted: Sat Feb 16, 2008 6:10 am |
|
|
|
|
Try using styles
| Code: |
<table border="1">
<tr>
<td style="width: 200px;"> </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
|
Posted: Sat Feb 16, 2008 7:17 am |
|
|
|
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
|
Posted: Sat Feb 16, 2008 7:28 am |
|
|
|
| also, i m not allow to post the php script here |
|
tweakmy
Joined: 16 Feb 2008 Posts: 7
|
Posted: Sat Feb 16, 2008 8:12 am new finding |
|
|
|
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
|
Posted: Sat Feb 16, 2008 8:21 am |
|
|
|
| it seems that th would not wrap the text automatically...why? |
|
madprof
Joined: 26 Jan 2008 Posts: 98
|
Posted: Sat Feb 16, 2008 9:47 am |
|
|
|
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.  |
|
tweakmy
Joined: 16 Feb 2008 Posts: 7
|
Posted: Mon Feb 18, 2008 12:55 am |
|
|
|
ok, i solve the case already. in the hidden input value, there s a line of many " ".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, PS :BFOS 6.6 :SPARE MV :I ,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'> </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

Joined: 15 May 2004 Posts: 8154 Location: Castle Rock CO USA
|
|
billy48
Joined: 28 Feb 2008 Posts: 1
|
Posted: Thu Feb 28, 2008 3:16 pm |
|
|
|
| good catch! |
|
|