Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 676955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:59:09+00:00 2026-05-14T00:59:09+00:00

I have recently been working on a Pastebin script (for fun) and I’ve come

  • 0

I have recently been working on a Pastebin script (for fun) and I’ve come across a problem that I can’t seem to solve in CSS. I have a table with 2 columns. 1 column is used to display the line numbers and the 2nd column is used to display the code. I can’t seem to get the numbers match up with the lines in the code so it looks all weird (example: http://www.zamnproductions.com/paste.php?id=32). Take a look at my code (the snippet):

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <style type="text/css">
      td.num {
       vertical-align: top;
      }
      td.numbers {
       display:table-cell;
       padding:1px;
       vertical-align: top;
       line-height:25px;
      }
      td.code {
       display:table-cell;
       vertical-align: top;
       line-height:20px;
      }
      #hide {
       display:none;
      }
      #leftcontent {
       position: absolute;
       left:10px;
       top:119px;
       width:200px;
       background:#fff;
       border:0px solid #000;
      }
      #centercontent {
       background:#fff;
       margin-left: 199px;
       margin-right:199px;
       border:0px solid #000;
       voice-family: "\"}\"";
       voice-family: inherit;
       margin-left: 201px;
       margin-right:201px;
       }
      html>body #centercontent {
      margin-left: 202px;
      margin-right:201px;
      }
    </style>

Here is the part where the table is made:

<?php 
if (isset($_GET['id'])) {
 $paste = new Paste();?>
 <table border="1">
 <tr>
 <td class="num"><font size="2"><?php $paste->listNumbers($_GET['id']); ?></font></td>
 <td class="code"><?php $paste->viewCode($_GET['id']); ?></td>
 </tr>
 </table>
<?php }?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:59:09+00:00Added an answer on May 14, 2026 at 12:59 am

    Your resulting table structure is off.

    This is what your script is outputting.

    <table border="1">
        <tr>
            <td class="num">
                <font size="2">
                <table border="0">
                    <tr>
                        <td class="numbers">1.</td>
                    </tr>
                    <tr>
                        <td class="numbers">2.</td>
                    </tr>
                    [...]
                </table>
                </font>
            </td>
            <td class="code">
                <pre><b>for</b> (<b>int</b> i = 5; i == 5; i++) 
                {
                System.out.pr<b>int</b>ln(&quot;LOLOL&quot;);
                }</pre><br/>
            </td>
        </tr>
    </table>
    

    When it should output something more like:

    <table border="1">
        <tr>
            <td class="num">1.</td>
            <td class="code">
                <pre><b>for</b> (<b>int</b> i = 5; i == 5; i++)</pre>
            </td>
        </tr>
        <tr>
            <td class="num">2.</td>
            <td class="code">
                <pre>{</pre>
            </td>
        </tr>
    </table>
    

    You want each table row to consist of two columns, one with the number and one with the code. Your script is throwing all the numbers into one column. You should split the code into lines, then foreach through the listNumbers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working on website recently and have come across a major problem :http://jimbob.webatu.com/index.html(you'll
Recently I have been working on sockets in C++ and I have come across
I have been working with databases recently and before that I was developing standalone
I have a stored procedure that has been working just fine, but I recently
I have recently been working with a COM+ component that processes an input XML
I've been working on some solutions for some questions that have been recently posted
I have recently been tasked to working on code that uses Java CUP. Does
I have an odd problem that I just can't seem to diagnose, and it
Recently I have been working with the xml coding,and the problem happened. Given the
So recently I have been working on phonebook project that uses Binary Search Tree.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.