Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

quick question on table data<td>

  • 21-04-2004 4:40pm
    #1
    Banned (with Prison Access) Posts: 13,018 ✭✭✭✭


    this may be a dumb question but anyway
    is there a way to specify a maxlength in td tag

    i have data coming from a a mysql data base and some od the data are going off the screen like so

    "32132b31b2322132b1321321b3213233b213213213213213213213213213213213213213213213a21321a321321321a3213232131a543547858976234213"`

    (sorry)
    i want it to be broken into 2 or 3 lines like so
    "
    143241a343243a24d214d324
    32423a1432d14a21d32d412a432
    432432432142432432a432"

    thought that this would be an easy way around it
    sorry about the mess but im working with raw hex payloads here so it aint much different and sorriy if in the wrong forum.


Comments

  • Registered Users, Registered Users 2 Posts: 1,031 ✭✭✭buddy


    How about specifying something like td width=100%


  • Registered Users, Registered Users 2 Posts: 236 ✭✭richardo


    Or set it to a fixed absolute width <td width='100'>


  • Closed Accounts Posts: 2,525 ✭✭✭JustHalf


    I think you need to look at your over-all strategy. First, why are you displaying the data in the first place?

    If you're displaying the data to be read from the screen, any solution that does not display all of the data isn't going to work all that well.

    You could look at using the CSS overflow: property to add scroll-bars to the cell if it gets too large/

    HTML:
    <table class="magictables">
      <tr>
        <td>DATADATADATADATA....</td>
      </tr>
    </table>
    


    CSS:
    table.magictables tr td {
      overflow: auto;
      }
    

    I don't know if that'll work though, you might have to add in a wrapper div:

    HTML:
    <table class="magictables">
      <tr>
        <td><div class="bigdata">DATADATADATADATA....</div></td>
      </tr>
    </table>
    


    CSS:
    table.magictables tr td div.bigdata {
      overflow: auto;
      }
    

    And cleaned up:

    HTML:
    <table>
      <tr>
        <td><div class="bigdata">DATADATADATADATA....</div></td>
      </tr>
    </table>
    


    CSS:
    div.bigdata {
      overflow: auto;
      }
    

    These are just ideas; I haven't tested them out, so there's no guarantee they'll work. This is something you should look at though.


  • Banned (with Prison Access) Posts: 13,018 ✭✭✭✭jank


    i need to display the data to teh screen

    sorry if i wasnt clear the <TD width=100> doeant work
    it only gives me blank cells
    what i wanted was the to FORCE the data to loop onto another row or line
    ie. once it hit the end of the cell it would go to a new line and then print out more data and so on so...
    thought there would be an easy solution but it dont think so

    im using php(only for a week or two) aswell so is there a function can tie in with the output?


  • Closed Accounts Posts: 4,655 ✭✭✭Ph3n0m


    Originally posted by jank
    i need to display the data to teh screen

    sorry if i wasnt clear the <TD width=100> doeant work
    it only gives me blank cells
    what i wanted was the to FORCE the data to loop onto another row or line
    ie. once it hit the end of the cell it would go to a new line and then print out more data and so on so...
    thought there would be an easy solution but it dont think so

    im using php(only for a week or two) aswell so is there a function can tie in with the output?

    I am presumming there is no break in the data?? i.e. "234234234234" and not "2342 234234 234234"

    unfortunately no browser automatically breaks a string of data up like that, there has to be a physical break in the data, i.e. spaces this allows a browser to "wrap" text in a cell.


    With php you can use this function


    http://ie2.php.net/wordwrap


    very nice to use - but you should really avoid using data with no breaks


  • Advertisement
  • Banned (with Prison Access) Posts: 13,018 ✭✭✭✭jank


    yea cheers that worked a treat
    [PHP]$data = wordwrap($myrow[ip_payload], 30, "\n", 1);[/PHP]
    then just echo the $data :)

    i couldnt break the data up because the data are payloads from from snort

    cheers again


Advertisement