SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    fitting Ul tags in Table tags ?

    help on this guys


    instead of this
    HTML Code:
    <table>
    <td rowspan="4"></td> 
    <td height="49"><strong>Rating and Review:</strong></td><td align="center"><a href="#">Add Review</a></td>
    <tr>
      <td rowspan="1" height="4" ><table style="font-size:10; position:relative; 
    left:26px;">
    <td width="58">five star</td>
      <td width="40">*****</td>
      <td width="25">[23]</td> 
    The ul above will have a php while loop that will repeat it automatically? 
    */
    
    <td width="58">One star</td>
      <td width="40">*****</td>
      <td width="25">[23]</td>
      </table></td>
    </tr><td rowspan="2"></td>
    <tr><td height="4"><table style="font-size:10; position:relative; left:26px; ">
      <td width="58">two star</td>
      <td width="40">*****</td>
      <td width="25">[23]</td>
      </table></td>
    </tr>
    <td width="321" rowspan="7"></td>
    
    <td width="340" rowspan="7">&nbsp;</td>
      <td width="400" height="4"><table style="font-size:10; position:relative; left:26px;">
      <td width="58">three star</td>
      <td width="40">*****</td>
      <td width="25">[23]</td>
      </table></td>
      <tr><td width="400" height="4"><table style="font-size:10; position:relative; left:26px;">
      <td width="58">four star</td>
      <td width="40">*****</td>
      <td width="25">[23]</td>
      </table></td></tr>
      <td width="400" height="4"><table style="font-size:10; position:relative; left:26px;">
      <td width="58">five star</td>
      <td width="40">*****</td>
      <td width="25">[23]</td>
      </table></td>
      <tr>
        <td height="4" colspan="2"><img src="../images/line..gif" alt="df" width="330" height="7" /></td>
      </tr>
    <tr>
      <td width="400" height="52"><strong>Items Specifications:</strong></td>
    </tr>
        <td width="400" height="4" style="font-size:11;"><ul>
          <li>Lemon</li>
        </ul></td>
    <tr>
      <td width="400" height="4" style="font-size:11;"><ul>
        <li>Marincra</li>
      </ul></td>
    </tr>
      <td width="321" height="29" rowspan="5">&nbsp; </td>
    <td width="340" height="29" rowspan="5">&nbsp;</td>
        <td height="1" colspan="1" style="font-size:11;"><ul>
          <li>Sal</li>
        </ul></td>
        <tr>
          <td height="1" style="font-size:11;"><ul>
            <li>Tomatos</li>
          </ul></td>
        </tr> <tr>
          <td height="1" style="font-size:11;"><ul>
            <li>Plums</li>
          </ul></td>
        </tr> <tr>
          <td height="1" style="font-size:11;"><ul>
            <li>Saludos</li>
          </ul></td>
        </tr> <tr>
          <td height="1" style="font-size:11;"><ul>
            <li>Asucar</li>
          </ul></td>
        </tr>
      
    </table>
    I want to achieve what's below to fit and <ul> tags inside of td? because the css style of the ul below is styled in the CSS style sheet as ul and it means I will have to change everything is there a way to fit the ul inside the table and td format as it is below?

    If you notice the html code above has 5 repetitions instead the code below with the ul will repeat 5 times but with a php script that will automatically repeated..


    HTML Code:
        <td rowspan="4"></td> 
    <td height="49"><strong>Rating and Review:</strong></td><td align="center"><a href="#">Add Review</a></td>
    <tr>
      <td rowspan="1" height="4" ><table style="font-size:10; position:relative; 
    left:26px;">
    /* the ul below will repeat five times or five row of 5 star*/
     '<h3>'.($K+1).' Star Active</h3>
          <ul class="rating '.$num.'star">
    	  <li class="one">1</li>
          <li class="two">2</li>
          <li class="three">3</li>
          <li class="four">4</li>
          <li class="five">5</li>
          <li class="total">['.$total[$K+1].']</li>
          </ul>'
    /* instead of using the td below I will be using the same format of the css style that display the rating effect but I have read that displaying ul inside of td is not good. */
    /* instead of manually repeated this five times
    <td width="58">five star</td>
      <td width="40">*****</td>
      <td width="25">[23]</td> 
    The ul above will have a php while loop that will repeat it automatically? 
    */

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't understand the question.
    Is this an HTML question, or is it a CSS question or a PHP question?
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,194
    Mentioned
    17 Post(s)
    Tagged
    5 Thread(s)
    Is this code for this page:



    If so you should consider a more semantic structure such as the below rather then using tables. However, either way you will probably need to rewrite the CSS specific to the new structure.

    HTML Code:
    <h1>Nike Air Jordan</h1>
    <img src="/img/nike_air_jordan.jpg" width="200" height=200" alt="Nike Air Jordan Shoes">
    	
    <dl>
    	<dt>Price:</dt>
    	<dd>$90.23</dd>
    	<dt>Rating:</dt>
    	<dd>5 stars</dd>
    </dl>
    
    <dl>
    	<dt>Users Rates for Nike Air Jordon</dt>
    	<dd>1 Star Active <span>[20]</span></dd>
    	<dd>2 Stars Active <span>[40]</span></dd>
    	<dd>3 Stars Active <span>[60]</span></dd>
    	<dd>4 Stars Active <span>[80]</span></dd>
    	<dd>5 Stars Active <span>[100]</span></dd>
    </dl>
    Last edited by oddz; Jul 27, 2009 at 23:14.

  4. #4
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    perfect thank you oddz, I will re-write the html code.


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
  •