SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast Nawaz Ijaz's Avatar
    Join Date
    Feb 2005
    Location
    Lahore, Pakistan
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <DIV> inside <Table> -- any solution?

    HI All, actualy i am trying to apply <DIV> tag on <Table> Rows... i havn't find any help so far... Below code segment works fine as <DIV> is applied outside the <Table>;

    Code:
    <div id="ddd" style="position: absolute; width: 10%; z-index: 1; overflow: auto; left: 1;">
    <table width="100%" border="1">
    
    		<colgroup>
    	      		<col width="12%">
    	      		<col width="36%">
    	      		<col width="30%">
    	      		<col width="13%">
    	      		<col width="9%">
          	<colgroup>
    		  <tr>
    				<td> 11 &nbsp;</td>
    				<td> 11&nbsp;</td>
    				<td> 11&nbsp;</td>
    				<td>11&nbsp;</td>
    				<td>11&nbsp;</td>
    		  </tr>
    			  <tr>
    				<td>22&nbsp;</td>
    				<td>22&nbsp;</td>
    				<td>22&nbsp;</td>
    				<td>22&nbsp;</td>
    				<td>22&nbsp;</td>
    			  </tr>
    			  <tr>
    				<td>33&nbsp;</td>
    				<td>33&nbsp;</td>
    				<td>33&nbsp;</td>
    				<td>33&nbsp;</td>
    				<td>33&nbsp;</td>
    				</tr>
    			  <tr>
    				<td>44&nbsp;</td>
    				<td>44&nbsp;</td>
    				<td>44&nbsp;</td>
    				<td>44&nbsp;</td>
    				<td>44&nbsp;</td>
    				</tr>
    			  <tr>
    				<td>55&nbsp;</td>
    				<td>55&nbsp;</td>
    				<td>55&nbsp;</td>
    				<td>55&nbsp;</td>
    				<td>55&nbsp;</td>
    		  </tr>
    </table>
    </div>

    BUT i want to apply <DIV> tag on Rows <TR> only rather the whole table <TABLE>.... how can i make this possible ?? Below code segment fails for me as it don't apply <Div> tag on Rows<tr>.....



    Code:
    <table width="100%" border="1">
    
    		<colgroup>
    	      		<col width="12%">
    	      		<col width="36%">
    	      		<col width="30%">
    	      		<col width="13%">
    	      		<col width="9%">
          	<colgroup>
    		
      <tr>
    				<td> 11 &nbsp;</td>
    				<td> 11&nbsp;</td>
    				<td> 11&nbsp;</td>
    				<td>11&nbsp;</td>
    				<td>11&nbsp;</td>
    		  </tr>
    			  <tr>
    				<td>22&nbsp;</td>
    				<td>22&nbsp;</td>
    				<td>22&nbsp;</td>
    				<td>22&nbsp;</td>
    				<td>22&nbsp;</td>
    			  </tr>
    			  <tr>
    				<td>33&nbsp;</td>
    				<td>33&nbsp;</td>
    				<td>33&nbsp;</td>
    				<td>33&nbsp;</td>
    				<td>33&nbsp;</td>
    				</tr>
    			  <tr>
    				<td>44&nbsp;</td>
    				<td>44&nbsp;</td>
    				<td>44&nbsp;</td>
    				<td>44&nbsp;</td>
    				<td>44&nbsp;</td>
    				</tr>
    			  <tr>
    				<td>55&nbsp;</td>
    				<td>55&nbsp;</td>
    				<td>55&nbsp;</td>
    				<td>55&nbsp;</td>
    				<td>55&nbsp;</td>
    		  </tr>
    </table>
    </div>
    Nawaz Ijaz [Lahore, Pakistan]
    Boy: He is big..i wont like to fight him...
    Achilles: Thatz Y no one wud remember u after thousand years...!!

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't understand, you want to apply div's to tr's? Why would that be? That would be invalid HTML

  3. #3
    SitePoint Enthusiast Nawaz Ijaz's Avatar
    Join Date
    Feb 2005
    Location
    Lahore, Pakistan
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PLease advise...!!

    Quote Originally Posted by Pepejeria View Post
    I don't understand, you want to apply div's to tr's? Why would that be? That would be invalid HTML

    Yes, you are right... actually i wana make a generic webpage template that will be used to generate only the table rows in a loop according to my business logic... idea is to implement it through AJAX and only <tr>'s should be generated and return to my html page....

    Code:
    <table width="100&#37;" border="1">
    		<colgroup>
    	      		<col width="12%">
    	      		<col width="36%">
    	      		<col width="30%">
    	      		<col width="13%">
    	      		<col width="9%">
               	<colgroup>
    	     
                    <tr>
    		        <td> Column 01 </td>
    			<td> Column 02 </td>
    			<td> Column 03 </td>
    			<td> Column 04 </td>
    			<td> Column 05 </td>
      	        </tr>
    </table>

    So what i really want a <DIV> outside <tr>, if this is not possible then is there any alternate way to achieve below functionality???

    <div>
    <tr>
    <td> Column 01 </td>
    <td> Column 02 </td>
    <td> Column 03 </td>
    <td> Column 04 </td>
    <td> Column 05 </td>
    </tr>
    </div>

    Please advice...!!
    Nawaz Ijaz [Lahore, Pakistan]
    Boy: He is big..i wont like to fight him...
    Achilles: Thatz Y no one wud remember u after thousand years...!!

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Simple answer: No

    next...
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  5. #5
    SitePoint Enthusiast Nawaz Ijaz's Avatar
    Join Date
    Feb 2005
    Location
    Lahore, Pakistan
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logic_earth View Post
    Simple answer: No

    next...
    am looking for little complex answers here from GURUs like you...well i believe every thing is possible that one can think... i wonder why html cant really do this simple thing for me there must be some ways other than <DIV> ??
    Nawaz Ijaz [Lahore, Pakistan]
    Boy: He is big..i wont like to fight him...
    Achilles: Thatz Y no one wud remember u after thousand years...!!

  6. #6
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its invalid HTML, thats why it doesn't work. Check out the HTML specification to see what tags are allowed inside a TABLE. You might wanna look into the tbody tag that can contain one or more tr tags...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •