skeener Posted February 7, 2007 Share Posted February 7, 2007 The table border did not appear when there is no data queried from the database. It happens only in I.Explorer and not in firefox. how to overcome this problem in I.E ? thus the table looks odd when there are some rows and columns which have no border lines. helps is much appreciated Quote Link to comment https://forums.phpfreaks.com/topic/37415-the-table-border-not-appear/ Share on other sites More sharing options...
hvle Posted February 7, 2007 Share Posted February 7, 2007 if there is no data returned, instead of print nothing, fill it with a non-breaking space: Quote Link to comment https://forums.phpfreaks.com/topic/37415-the-table-border-not-appear/#findComment-178846 Share on other sites More sharing options...
skeener Posted February 7, 2007 Author Share Posted February 7, 2007 and please teach me how to do that.... after fetching the array in php i'm echoing the <tr> inside the html table <table> how to echo the nbsp? Quote Link to comment https://forums.phpfreaks.com/topic/37415-the-table-border-not-appear/#findComment-178851 Share on other sites More sharing options...
hvle Posted February 7, 2007 Share Posted February 7, 2007 I have see your code. Quote Link to comment https://forums.phpfreaks.com/topic/37415-the-table-border-not-appear/#findComment-178861 Share on other sites More sharing options...
skeener Posted February 7, 2007 Author Share Posted February 7, 2007 here is the php part: $table1 .= " <tr> <td align=\"center\"><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">$Staff_no1</td> <td align=\"center\"><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">$thename</font></td> <td align=\"center\"><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">$lanid</font></td> <td align=\"center\"><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">$enrolldate</font></td> <td align=\"center\"><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">$enrollstatus</font></td> <td align=\"center\"><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">$completiondate</font></td> <td align=\"center\"><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">$score</font></td> </tr> "; and here is the html part: <table width="100%" border="1" cellspacing="1" cellpadding="1" align="center"> <tr bgcolor="#06AA3C"> <td width="7%"><div align="center"><font face="Arial, Helvetica, sans-serif"><strong><font color="#FFFFFF" size="2">Staff No.</font></strong></font></div></td> <td width="23%" height="43"> <div align="center"><font face="Arial, Helvetica, sans-serif"><strong><font color="#FFFFFF" size="2">Name</font></strong></font></div></td> <td width="9%"><div align="center"><font face="Arial, Helvetica, sans-serif"><strong><font color="#FFFFFF" size="2">Lan ID</font></strong></font></div></td> <td width="24%"> <div align="center"><font face="Arial, Helvetica, sans-serif"><strong><font color="#FFFFFF" size="2">Enrollment Date</font></strong></font></div></td> <td width="7%"><div align="center"><font face="Arial, Helvetica, sans-serif"><strong><font color="#FFFFFF" size="2">Progress Status</font></strong></font></div></td> <td width="24%"> <div align="center"><font face="Arial, Helvetica, sans-serif"><strong><font color="#FFFFFF" size="2">Completion Date</font></strong></font></div></td> <td width="10%"><div align="center"><font face="Arial, Helvetica, sans-serif"><strong><font color="#FFFFFF" size="2">Score</font></strong></font></div></td> </tr> <?php echo $table1; ?> </table> thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/37415-the-table-border-not-appear/#findComment-178925 Share on other sites More sharing options...
hvle Posted February 7, 2007 Share Posted February 7, 2007 take this line for example: <td align=\"center\"><font size=\"2\" face=\"Arial, Helvetica, sans-serif\">$Staff_no1</td> if (empty($Staff_no1)) $Staff_no1 = ' '; of course, do this before it being output to table. and do this for every instance that possibly be empty. Quote Link to comment https://forums.phpfreaks.com/topic/37415-the-table-border-not-appear/#findComment-178929 Share on other sites More sharing options...
skeener Posted February 7, 2007 Author Share Posted February 7, 2007 Thanks a lot man... it workssssss ! i really appreciate your help Quote Link to comment https://forums.phpfreaks.com/topic/37415-the-table-border-not-appear/#findComment-178934 Share on other sites More sharing options...
mmarif4u Posted February 7, 2007 Share Posted February 7, 2007 Hi,,, I try this but not work how can i edit this... echo "<td Align=center width=8%>" . $row['email'] . "</td>"; if (empty($row['email'])) $row['email'] = ' '; Quote Link to comment https://forums.phpfreaks.com/topic/37415-the-table-border-not-appear/#findComment-178948 Share on other sites More sharing options...
hvle Posted February 7, 2007 Share Posted February 7, 2007 you need to reverse the 2 lines: if (empty($row['email'])) $row['email'] = ' '; echo "<td Align=center width=8%>" . $row['email'] . "</td>"; Quote Link to comment https://forums.phpfreaks.com/topic/37415-the-table-border-not-appear/#findComment-178952 Share on other sites More sharing options...
JasonLewis Posted February 7, 2007 Share Posted February 7, 2007 switch those 2 lines around. Quote Link to comment https://forums.phpfreaks.com/topic/37415-the-table-border-not-appear/#findComment-178955 Share on other sites More sharing options...
mmarif4u Posted February 7, 2007 Share Posted February 7, 2007 Thanks guys its working now... Quote Link to comment https://forums.phpfreaks.com/topic/37415-the-table-border-not-appear/#findComment-178982 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.