Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Regular Coder
    Join Date
    Sep 2018
    Posts
    122
    Thanks
    27
    Thanked 0 Times in 0 Posts
    I have been thinking that perhaps the white space has something to do with my padding, not implementing else where but can't figure that out......I have decided to take out the create sub category option because only myself could do that but in the middle section, the grey section is still being pushed inwards....

    Code:
     $limit = 1;
                    
    		            $sql3 = "SELECT * FROM music_forum_cats;";
    
    		         $stmt = mysqli_stmt_init($conn);
    
                    if(!mysqli_stmt_prepare($stmt, $sql3)) {
    			           echo "SQL error";
    			        } else {
                    
    			          mysqli_stmt_execute($stmt);
    			          $result3 = mysqli_stmt_get_result($stmt);
    			          $resultCheck3 = mysqli_num_rows($result3);
    
                     
                    while ($row3 = mysqli_fetch_assoc($result3)) {
                      $cat = $row3['id'];
    
    			          if ($resultCheck3 < 1) {
    			          	 echo "<meta http-equiv='refresh' content='0;url=create_music_cat.php?display_music_forum=nocategories'>"; 
    			          	 exit();
    			          } else {
                      
                      $sql4 = "SELECT * FROM music_forum_sub_cats WHERE cat_id = ? limit ?;";
    
                      $stmt = mysqli_stmt_init($conn);
    
                    if(!mysqli_stmt_prepare($stmt, $sql4)) {
                     echo "SQL error";
                  } else {
                   mysqli_stmt_bind_param($stmt, "ii", $cat, $limit);
                    mysqli_stmt_execute($stmt);
                    $result4 = mysqli_stmt_get_result($stmt);
                    $resultCheck4 = mysqli_num_rows($result4);
                        
                      
                      
                         while ($row4 = mysqli_fetch_assoc($result4)) {
                       
                         echo '
          
          <table class="categories">
         
            <thead>
              
              
              <tr>
              <th scope="col"> Category</th><td>
                   ',$row3['category'],'</td></div>
              </tr>
               <tr>
                <th scope="col">Sub Category</th><td><a href="display_music_forum_topics.php?cat='.$row3['id'].'&admin='.$row3['admin'].'&topic_id='.$row4['id'].'">'.$row4['sub_category'].'</a></td>
                </tr>
              <tr>
                <th scope="col">Creator</th><td>'.$row3['user_uid'].'</td>
                </tr>
                <tr>
                <th scope="col">Date Created</th><td>'.$row3['date_created'].'</td>
              </tr>
            </thead><tbody>
    
    This is my CSS:
    
    .categories th {
      padding: 20px;
      background-color: #808080;
    }
    
    .categories td {
      background-color: #FAEBD7;
      padding: 20px;
    }

    I have been trying to use padding-left to push it but it is just getting to the point where it is almost too far to the right....
    Last edited by piano0011; Sep 15th, 2018 at 12:12 PM. Reason: clarify question

  2. #17
    Regular Coder
    Join Date
    Sep 2018
    Posts
    122
    Thanks
    27
    Thanked 0 Times in 0 Posts
    Hey guys!

    I will update the following code for my display forum and reply forum section with the relevant css:

    Code:
     echo '<table class="categories">
          
         
         
            <thead>
              
              
              <tr>
              <th scope=""> Category</th><td>
                   ',$row3['category'],'</td>
              </tr>
               <tr>
                <th scope="">Sub Category</th><td><a href="display_music_forum_topics.php?cat='.$row3['id'].'&admin='.$row3['admin'].'&topic_id='.$row4['id'].'">'.$row4['sub_category'].'</a></td>
                </tr>
              <tr>
                <th scope="">Creator</th><td>'.$row3['user_uid'].'</td>
                </tr>
                <tr>
                <th scope="">Date Created</th><td>'.$row3['date_created'].'</td>
              </tr>
              </thead><tbody>
    
        
    
        
    
      
                  
                  
                 
                  
                  
                  
                   
              
          </table>';
    
    This is the CSS code;
    
    .categories {
      background-color: #FAEBD7;
     position: relative;
      left: 10px;
      border-radius: 10px;
    
    }
    
    .categories td {
      padding-left: 20px;
    
    }
    
    .categories th {
      padding: 20px;
    }
    
    This is my reply section:
    
     echo '<form action="create_music_topics_reply_process.php" method="POST">';
    
                     echo '<table class="create_music_topics_reply" width=100%>
                          <tr>
                          <th>Sub Category</th><td>'.$row['sub_category'].'</td>
                          </tr>
                          <tr>
                          <th>Topic Title</th><td>'.$row2["topic_title"].'</td><td><input type="hidden" name="topic_title" value="'.$topic_title.'"></td>
                          </tr>
                          <tr>
                          <th>Topic Description</th><td>'.$row2['topic_description'].'</td>
                          </tr>
                          <tr>
                          <th>Creator</th><td>'.$row2['user_uid'].'</td><td><input type="hidden" name="creator" value="'.$creator.'"></td>
                          </tr>
                          <tr>
                          <th>Date Created</th><td>'.$row2['date_created'].'</td>
                          </tr>
                          <tr>
                          <th>Date replied</th><td>'.$row2['date_reply'].'</td>
                          </tr>
                          <tr>
                          <th class="hidden"></th><td class="hidden2"><input type="hidden" name="cat" value="'.$cat.'"></td>
                          </tr>
                          <tr>
                          <th class="hidden"></th><td class="hidden"><input type="hidden" name="topic_id" value="'.$topic_id.'"></td>
                          </tr>';
                          
                           
                         
                      }
    
                         
                     }
                        echo '</tr>
                          <td colspan="2"><input type="submit" name="submit" value="Reply"></td>
                          </tr>
                           <tr>
                          <td colspan="2" id=><textarea rows="5" columns="40" name="reply"></textarea></td>
                          </tr>
                          </form>';
                           
      This is the CSS:
    
    .create_music_topics_reply {
      position: relative;
      left: 10px;
     
    }
    
    .create_music_topics_reply th {
      background-color: #808080;
       padding: 20px;
    }
    
    .create_music_topics_reply td {
      background-color: #FAEBD7;
      padding-left: 20px;
    
    }
    
    .create_music_topics_reply textarea {
      position: relative;
      left: 700px;
      margin-bottom: 100px;
    }
    
    .create_music_topics_reply [type=submit] {
      position: relative;
      top: 220px;
      left: 810px;
    }
    
    
    
    .create_music_topics_reply .hidden {
      background-color: #808080;
    }
    At the moment, it looks like this:

    -forum11-jpg

    -forum12-jpg-forum12-jpg

    As can be seen from the pictures, I am not sure why for the first picture, my headings have been indented and also not sure why there are white spaces in my reply section.. I guess I haven't styled a particular section but not sure which one..I am also not sure why the border-radius is not working for my categories class of 10px..
    Last edited by piano0011; Sep 15th, 2018 at 01:25 PM. Reason: clarify question

  3. #18
    Regular Coder
    Join Date
    Sep 2018
    Posts
    122
    Thanks
    27
    Thanked 0 Times in 0 Posts
    Hey guys!

    I really need some assistance here... The only thing that I can think off is to copy my other code and paste it there but then I won't be learning anything much i guess...

    ok.. I tried to copy and paste but ended with the same problem couldd this be due to a length issue in my database??
    Last edited by piano0011; Sep 16th, 2018 at 06:00 AM.

  4. #19
    Regular Coder
    Join Date
    Sep 2018
    Posts
    122
    Thanks
    27
    Thanked 0 Times in 0 Posts
    I got it working by adding a width attribute but not sure why it was doing this in the first place whereas for my other forum reply, I didn't have to add a width attribute...

  5. #20
    Senior Coder deathshadow's Avatar
    Join Date
    Feb 2016
    Location
    Keene, NH
    Posts
    3,086
    Thanks
    4
    Thanked 447 Times in 436 Posts
    Tables collapse to the width of their content. Because not all your tables had the same width content, they weren't the same width.

    NOT that ANY of that should be tables as that is not tabular data. If it WERE tabular data they would all be ONE contiquous table, not multiple smaller ones.

    In that way using tables for this is semantic gibberish and should be avoided. It is NOT tabular data so that's completely the wrong markup for it!

    That and all the pixel measurement crap, bizzaro left relative slide, etc, etc does'nae make a lick of sense and tells users with accessibility needs to go plow themselves.

    Really not sure overall what you're even trying to go for in terms of layout OR CONTENT here anyhow. Content first, semantics second, layout LAST. You seem to be skipping right past that middle one. Likely again from that dumbass tutorial I keep telling you to forget EVERYTHING it taught you.
    “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.” – C.A.R. Hoare, The 1980 ACM Turing Award Lecture
    http://www.cutcodedown.com

  6. #21
    Regular Coder
    Join Date
    Sep 2018
    Posts
    122
    Thanks
    27
    Thanked 0 Times in 0 Posts
    Are there any good videos on how to do a tabular data? I will check on youtube


 
Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

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