Table Problem?

This is a discussion on "Table Problem?" within the Web Page Design section. This forum, and the thread "Table Problem? are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 23rd, 2006, 01:08
Junior Member
Join Date: Nov 2005
Age: 28
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Table Problem?

If i have a internal table inside another table, and the internal table contains an invalid table(example: no closing tr tag, etc), this will affect all table layout. So how can i preserve the table layout that the "invalid inner table" will not affect other table setting? For example:

Code: Select all
 
<TABLE>
<TR>
<TD Width="50%">Test1</TD>
<TD>Test2</TD>
</TR>
<TR>
<TD>
<!-- start invalid table -->
<TABLE>
<TR>
<TD>Invalid table</TD>
<TR>
<TR>
<TD>
<TABLE>
<TR>
<TD>Invalid Table</TD>
<TR>
<TD>
<TABLE>
<TR>
<TD>Wrong
<TD> Wrong 2
</TD>
</TR>
</TABLE>
<!-- end invalid table -->
</TD>
</TR> 
</TABLE>
Can some one solve the problem as fast as possible?
Reply With Quote

  #2 (permalink)  
Old Feb 23rd, 2006, 01:34
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sypher
Re: Table Problem?

Why would you want an invalid table?
Reply With Quote
  #3 (permalink)  
Old Feb 23rd, 2006, 01:45
craig's Avatar
Reputable Member
Join Date: Sep 2005
Location: Preston, UK
Age: 21
Posts: 381
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to craig
Re: Table Problem?

Why not just close the TR tags and go into the second table, unless you want to nest a table in a table in a table. I'm not sure I fully understand what your are trying to implement?
Reply With Quote
  #4 (permalink)  
Old Feb 23rd, 2006, 04:13
herkalees's Avatar
Highly Reputable Member
Join Date: Jul 2005
Location: Massachusetts, USA
Age: 87
Posts: 576
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to herkalees Send a message via MSN to herkalees Send a message via Yahoo to herkalees
Re: Table Problem?

I'd fix it all by losing the tables and doing it the right way... have a url, or more source code we can see?
Reply With Quote
  #5 (permalink)  
Old Feb 23rd, 2006, 08:34
Junior Member
Join Date: Nov 2005
Age: 28
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Table Problem?

Hi all,
Actually i'm doing a page that allow the user to enter his/her message in a text box and then the user's input content will be view in browser. If the user's input not contains any HTML tag, the page is normal in view. Otherwise, the output is unexpected. Below showing two examples which is one consist of normal user input and the output is good in view. Another one example is the user's input consist of invalid HTML tag, so the output screen is unexpected.

This example showing that the user input normal text:
Code: Select all
 
<HTML>
    <TR>
       <TD>
            <TABLE Width="100%" Border="0">
            <TR>
               <TD style="height:3pt;">
  </TD>
            </TR>
            <TR>
               <TD Width="17%">Original Message:</TD>
               <TD>
                  <DIV id="fraGroup" scrolling="yes" style="height:100;overflow-
y:scroll;background-color:#FFFFFF;border:groove 1px #FFFFFF">
                   <!-- Start Invalid Tabe here --> 
                    <TABLE Width="100%" Border="0" CellSpacing="0" CellPadding="0" 
Align="Center">
                        <TR>
                           <TD Colspan="3"/> 
                         </TR>
                         <TR>
                            <TD>
                                <P>Here will show something</P>
                             </TD>
                          </TR>
                          <TR>
                              <TD Height="12" Colspan="4">
                                 <Span style="overflow-x:hidden;overflow-y:visible;width:633.6">
                                     <!-- Here will show user's input for a message title -->
                                      Testing
                                 </Span>
                                 <BR/> 
                                 <Span style="overflow-x:hidden;overflow-y:visible;width:614.592">
          <!-- Here will show user's input for the message content. The problem 
is if he/she input a text that contains invalid HTML table tag, the screen is unexpected. For 
Example: --> 
This is User's input text that do not consist of any HTML tag
 
                                 </Span>
                               </TD>
                           </TR>
                          <TR><TD Height="3" Colspan="4">&nbsp;</TD></TR>
                     </TABLE>
                    <!-- End Invalid Table -->
                  </DIV>
               </TD>
            </TR>
            <TR>
               <TD Colspan="2" Height="3pt"/>
            </TR>
         </TABLE>
      </TD>
   </TR>
   <TR>
      <TD Colspan="3"/>
   </TR>
   <TR>
      <TD>
         <TABLE Width="100%" Border="0">
            <TR>
                <TD Width="17%">Title:</TD>
                 <TD Width="83%"><Textarea name="txtTitle"></Textarea></TD> 
             </TR>
         </TAbLE>
      </TD>
   </TR>
</HTML>
This example showing that the user input invalid HTML tag:
Code: Select all
 
<HTML>
    <TR>
       <TD>
            <TABLE Width="100%" Border="0">
            <TR>
               <TD style="height:3pt;">
  </TD>
            </TR>
            <TR>
               <TD Width="17%">Original Message:</TD>
               <TD>
                  <DIV id="fraGroup" scrolling="yes" style="height:100;overflow-
y:scroll;background-color:#FFFFFF;border:groove 1px #FFFFFF">
                   <!-- Start Invalid Tabe here --> 
                    <TABLE Width="100%" Border="0" CellSpacing="0" CellPadding="0" 
Align="Center">
                        <TR>
                           <TD Colspan="3"/> 
                         </TR>
                         <TR>
                            <TD>
                                <P>Here will show something</P>
                             </TD>
                          </TR>
                          <TR>
                              <TD Height="12" Colspan="4">
                                 <Span style="overflow-x:hidden;overflow-y:visible;width:633.6">
                                     <!-- Here will show user's input for a message title -->
                                      Testing
                                 </Span>
                                 <BR/> 
                                 <Span style="overflow-x:hidden;overflow-y:visible;width:614.592">
          <!-- Here will show user's input for the message content. The problem 
is if he/she input a text that contains invalid HTML table tag, the screen is unexpected. For 
Example: --> 
<Table><Tr><td>Invalid <TR>HTML<Table>Tag
 
                                 </Span>
                               </TD>
                           </TR>
                          <TR><TD Height="3" Colspan="4">&nbsp;</TD></TR>
                     </TABLE>
                    <!-- End Invalid Table -->
                  </DIV>
               </TD>
            </TR>
            <TR>
               <TD Colspan="2" Height="3pt"/>
            </TR>
         </TABLE>
      </TD>
   </TR>
   <TR>
      <TD Colspan="3"/>
   </TR>
   <TR>
      <TD>
         <TABLE Width="100%" Border="0">
            <TR>
                <TD Width="17%">Title:</TD>
                 <TD Width="83%"><Textarea name="txtTitle"></Textarea></TD> 
             </TR>
         </TAbLE>
      </TD>
   </TR>
</HTML>
As you can see the output for 2nd example is unexpected after the user's input. So how can i do to preserve my output as in example1 no matter what user's input content. I have tested with adding a table/Div/Span before the invalid table, but it is not function. Be aware that my screen is not as simple as in these examples. Can someone please help me to solve the problem?
Reply With Quote
  #6 (permalink)  
Old Feb 23rd, 2006, 12:22
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Re: Table Problem?

Why not just dissallow HTML from being entered?
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #7 (permalink)  
Old Feb 23rd, 2006, 23:54
Junior Member
Join Date: Nov 2005
Age: 28
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Table Problem?

How to disallow HTML? I want the user content to be shown.
Reply With Quote
  #8 (permalink)  
Old Feb 26th, 2006, 12:04
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
Re: Table Problem?

why not replace all instances of "<" in the post with "&lt;" and all instances of ">" in the post with "&gt;"
Reply With Quote
  #9 (permalink)  
Old Mar 1st, 2006, 09:31
Junior Member
Join Date: Nov 2005
Age: 28
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Table Problem?

The problem is not of the special characters. Can you imagine that i have 2 pages which 1 is to allow the user to input his/her message title and content, 1 page to show the message title and content in a message board(in HTML form, not in text form). For the maintenance page, let say i have 1 table for title(with textarea inside), 1 table for content(with textarea inside), and 1 table to build OK and Cancel button. When the user clicks on OK button, the message title and content will be inserted into database. Then the maintenance page is closed and return to Message Board page. In the page, all the messages will be shown in HTML format, not in text format. Thus, if the user title/content contains of HTML tag(example, message title: <Font color="#FF0000">First Message</Font>), the word "First Message" will be displayed in red color. So the user can form any HTML code at the maintenance page.
My problem is if the user gives the invalid HTML code for his/her message content, after the page returned from maintenance page to Message Board page, the invalid HTML code of the message content will affect my layout and the web GUI now will be unexpected. So my question is can i differentiate the invalid HTML table from affecting other HTML table? How can i do that?
Reply With Quote
Reply

Tags
table, problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Iframe / Table Problem.... help me!!! bigbluesky2006 Web Page Design 4 Dec 16th, 2006 10:59
Table conversion problem dartiss Web Page Design 9 Jul 26th, 2006 17:42
Table sizing problem Jaken Veina Web Page Design 1 Jan 6th, 2006 22:06
CSS and Table problem lisnalinchy Web Page Design 10 Aug 3rd, 2005 09:54
Expandable Table Problem legomaniac Web Page Design 3 Jul 15th, 2005 14:16


All times are GMT. The time now is 20:56.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43