SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict Mainer82's Avatar
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    td width with XHTML 1.1

    Is there an alternative to specifing width in a TD cell with XHTML 1.1?
    Get to know the man behind the screen

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    XHTML specifies content, CSS specifies layout.

    Code:
    td {
      width: 100px;
    }

  3. #3
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Why are you using the XHTML 1.1 DOCTYPE?

  4. #4
    SitePoint Addict Mainer82's Avatar
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    249
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I ment 1.0.
    Here's what I'm trying to do, I can make a tabless design easy enough, but what I am doing is pulling data from a DB and displaying it in a table form. I cannot figure out how to use CSS mixed with PHP:
    HTML Code:
    <? include('../iedb/includes/config.php'); ?>
     <? include('../includes/doctype.html'); ?><head>
        <title>Changle Log</title>
     <? include('../includes/header.php'); ?>
     
     <? include('../includes/nav_noactive.php'); ?>
     
     		<!-- page description -->
     		<div id="page_info">
     		   <h2>Change Log, <em>noun</em></h2>
     		   <div class="define">changes, alterations, performance tweaks pertaining to the code of Ogden2k.NET</div>
        </div>
        <!-- / page description -->
     
        <!-- left div box -->
        <div id="left_content">
     	  <h3>Version change log</h3>
     	  <br />
     	  <table class="table_head">
     		 <tr>
     		   <td width="60"><a href="index.php?order=clver">Version</a></td>
     		   <td width="360"><a href="index.php?order=cltext">Changes</a></td>
     		   <td width="80"><a href="index.php?order=cldate">Date</a></td>
     		 </tr>
     	  </table>
     	  <?
     	  // Request the text of all the info
     	  $order = isset($_GET['order']) ? mysql_escape_string($_GET['order']) : 'clver'; // Request the text of all the info
     	  $result = @mysql_query("SELECT * FROM changelog ORDER BY $order DESC");
     		 if (!$result) {
     			exit('<p>Error performing query: ' . mysql_error() . '</p>');
     	   }
     	  // Display each entry
     	  while ($row = mysql_fetch_array($result)) {
     	  echo '
     	  <table class="cells">
     		 <tr>
     			  <td width="60">' . $row['clver'] . '</td>
     			  <td width="360">' . $row['cltext'] . '</td>
     			  <td width="80">' . $row['cldate'] . '</td>
     		 </tr>
     	  </table>
     	  ';
     	 }
     	  $order = '';
     	  switch($_GET['order'])
     	  {
     	  case 'order':
     	   $order = 'id';
     	  break;
     
     	  case 'clver':
     	   $order = 'clver';
     	  break;
     
     	  case 'cltext':
     	   $order = 'cltext';
     	  break;
     
     	  case 'cldate':
     	   $order = 'cldate';
     	  break;
     
     	  default:
     	   $order = 'order';
     	  break;
     	  }
     	  ;
     	  ?>
     	  <img src="../i/clear.gif" alt="clear.gif" title="" width="1" height="100" />
        </div>
        <!-- / left div box -->
     
        <!-- right div box -->
        <div id="right_content">
     	  <br /><br /><br /><p class="cent"><img src="../i/clbg.gif" alt="clbg.fig" title="" /></p>
        </div>
        <!-- / right div box -->
     <? include('../includes/footer.php'); ?>
    Get to know the man behind the screen

  5. #5
    Non-Member lostseed's Avatar
    Join Date
    Sep 2005
    Location
    Zurconion Soon!
    Posts
    1,549
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could try inline styling. I hope this is what you are meaning
    PHP Code:
    echo '
           <table class="cells">
              <tr>
                   <td style="width: 60px;">' 
    $row['clver'] . '</td>
                   <td style="width: 360px;">' 
    $row['cltext'] . '</td>
                   <td style="width: 80px;">' 
    $row['cldate'] . '</td>
              </tr>
           </table>
           '

    If you want to use a CSS include with PHP, I believe it has to be in HTML form for CSS to work, I could be wrong.

    So in your php file you'd need html, head, body, etc, and change <? to <?php of course. Then use the regular linking to a css file. Is it that you are having a problem linking to a css file? Because that would be the problem I dont see any link to a CSS file that would say anything about the class "cells".

  6. #6
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The fact that you're using PHP to generate the HTML doesn't change anything you already know about HTML and CSS. Keep that in mind.


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
  •