As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
We're funding a new Acquisitions Incorporated series on Kickstarter right now! Check it out at https://www.kickstarter.com/projects/pennyarcade/acquisitions-incorporated-the-series-2

[Programming] Thread: Fixed last bug in 5 month thread

1757678808199

Posts

  • urahonkyurahonky Registered User regular
    edited July 2015
    Using straight HTML with CSS how do I get a table and an image to show up on the same line?

    HTML:
                <table>
                    <tr>
                        <th>Stuff</th>
                        <th>Person</th>
                        <th>Date</th>
                    <tr>
                    <tr>
                        <td class="case-display">DATA</td>
                        <td class="case-display">NAME<br/><span class="phone">Phone No.: 123-456-7894</span></td>
                        <td class="case-display">05/10/2015</td>
                    </tr>
                </table>
                <img src='test.jpg'/>
    

    urahonky on
  • TofystedethTofystedeth Registered User regular
    Actually WPF is fine for doing stuff quickly too.
    Now, if you want to do it right and get all MVVMy with fancy databindings and shit, yeah, it'll take a little longer, but you can pretty much ignore all that and treat it like WinForms if you're mocking up a thing to show someone, or handle some simple clicks and stuff.

    steam_sig.png
  • bowenbowen How you doin'? Registered User regular
    Actually WPF is fine for doing stuff quickly too.
    Now, if you want to do it right and get all MVVMy with fancy databindings and shit, yeah, it'll take a little longer, but you can pretty much ignore all that and treat it like WinForms if you're mocking up a thing to show someone, or handle some simple clicks and stuff.

    There's a lot less "help" on the interwebs for WPF vs winforms. It's arguably still slower because the WPF viewer thing crashes. A lot. Way more than it should.

    But it's competing with a product that's been around for nearly 20 years.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • TofystedethTofystedeth Registered User regular
    I've never had any trouble with the WPF viewer crashing. Though yeah, there's a lot of code out there for WinForms stuff which is half transferable, and half the "wrong way to do things" either philosophically or for legit technical reasons and hard to tell what's what sometimes.

    steam_sig.png
  • bowenbowen How you doin'? Registered User regular
    There's something about WPF that reminds me of the really crappy days when glade sucked.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • builderr0rbuilderr0r Registered User regular
    urahonky wrote: »
    Using straight HTML with CSS how do I get a table and an image to show up on the same line?

    HTML:
                <table>
                    <tr>
                        <th>Stuff</th>
                        <th>Person</th>
                        <th>Date</th>
                    <tr>
                    <tr>
                        <td class="case-display">DATA</td>
                        <td class="case-display">NAME<br/><span class="phone">Phone No.: 123-456-7894</span></td>
                        <td class="case-display">05/10/2015</td>
                    </tr>
                </table>
                <img src='test.jpg'/>
    

    In your CSS:

    table{
    display: inline-block;
    }

    steam_sig.png
    urahonkyDisruptedCapitalistDelmain
  • urahonkyurahonky Registered User regular
    builderr0r wrote: »
    urahonky wrote: »
    Using straight HTML with CSS how do I get a table and an image to show up on the same line?

    HTML:
                <table>
                    <tr>
                        <th>Stuff</th>
                        <th>Person</th>
                        <th>Date</th>
                    <tr>
                    <tr>
                        <td class="case-display">DATA</td>
                        <td class="case-display">NAME<br/><span class="phone">Phone No.: 123-456-7894</span></td>
                        <td class="case-display">05/10/2015</td>
                    </tr>
                </table>
                <img src='test.jpg'/>
    

    In your CSS:

    table{
    display: inline-block;
    }

    Thanks! Good luck on your OS exam.

  • builderr0rbuilderr0r Registered User regular
    edited July 2015
    Thanks...it didn't go too well lol.

    I got a 95 on the midterm though, and do well on the assignments so hopefully my final grade balances out okay.

    builderr0r on
    steam_sig.png
  • urahonkyurahonky Registered User regular
    I remember my OS class being one of the first classes that made me rethink my CS degree.

  • builderr0rbuilderr0r Registered User regular
    I think my hardest CS class so far was probably Assembly. Luckily I'll never have to use that again. :P

    steam_sig.png
  • KakodaimonosKakodaimonos Code fondler Helping the 1% get richerRegistered User regular
    OS was a pain in the ass because we had to try to independently write various pieces of the OS in groups. And the dumb group got the scheduler so nothing ever worked.

    But it did give me a taste of what projects in the real world usually end up like.

    EtheaLD50builderr0rCampyecco the dolphina5ehren
  • urahonkyurahonky Registered User regular
    builderr0r wrote: »
    I think my hardest CS class so far was probably Assembly. Luckily I'll never have to use that again. :P

    That class finally got me to understand pointers and memory addresses.

    I still got a D in the class, but I had fun with it.

    builderr0r
  • TofystedethTofystedeth Registered User regular
    I loved assembly and pretty much hated OS.

    steam_sig.png
  • urahonkyurahonky Registered User regular
    Holy shit. Creating a simple HTML page without javascript is painful as fuck.

    PolaritieDisruptedCapitalistironsizide
  • TomantaTomanta Registered User regular
    I hated my Assembly class because we were using an obscure, outdated version that required us to buy a photocopy of a book that went out of print in the mid 90s, required us to use an emulator (ok, that didn't bother me much except to reinforce that it was a bad language), and the only justification was the professor "knew of a company in Dallas that still used those servers").

    I guess it served it's purpose, but I always prefer to learn things that are relevant

    Same professor for about half my CS classes, I liked the guy but he was stuck in an 80s form of tech teaching in the early 00's.

  • bowenbowen How you doin'? Registered User regular
    urahonky wrote: »
    Holy shit. Creating a simple HTML page without javascript is painful as fuck.
    <html>
    <head>
        <title>Simple HTML Page W/O JavaScript</title>
    </head>
        <body>This is a simple HTML page without JavaScript.  It doesn't seem very painful.</body>
    </html>
    

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
    DisruptedCapitalistDelzhand
  • urahonkyurahonky Registered User regular
    bowen wrote: »
    urahonky wrote: »
    Holy shit. Creating a simple HTML page without javascript is painful as fuck.
    <html>
    <head>
        <title>Simple HTML Page W/O JavaScript</title>
    </head>
        <body>This is a simple HTML page without JavaScript.  It doesn't seem very painful.</body>
    </html>
    

    Bah, you know what I mean.

    Look at this: HOW AM I SUPPOSED TO CENTER THIS?!

    vOyIQLW.png

    Text is in a span. I have tried vertical-align, padding-top, margin-top... nothing has an effect.

  • bowenbowen How you doin'? Registered User regular
    urahonky wrote: »
    bowen wrote: »
    urahonky wrote: »
    Holy shit. Creating a simple HTML page without javascript is painful as fuck.
    <html>
    <head>
        <title>Simple HTML Page W/O JavaScript</title>
    </head>
        <body>This is a simple HTML page without JavaScript.  It doesn't seem very painful.</body>
    </html>
    

    Bah, you know what I mean.

    Look at this: HOW AM I SUPPOSED TO CENTER THIS?!

    vOyIQLW.png

    Text is in a span. I have tried vertical-align, padding-top, margin-top... nothing has an effect.

    I'd need to see your code, but JS wouldn't help you with this?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • bowenbowen How you doin'? Registered User regular
    <span style="text-align:center;background-color:#005DAB;color:#DDDDDD;display:block;width:500px;">Patient Information<span>
    

    Some bullshit like this should work.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • urahonkyurahonky Registered User regular
    Long story short: I need to be able to create an HTML page that will be converted to a PDF and then that PDF will be sent to a print queue. This all needs to happen on the back-end so the user will never actually see this page.

    I could write this thing in 5 minutes with React but since I don't think you can actually use Javascript in this html -> pdf converter I'm stuck doing it the old fashioned way.

  • urahonkyurahonky Registered User regular
    bowen wrote: »
    <span style="text-align:center;background-color:#005DAB;color:#DDDDDD;display:block;width:500px;">Patient Information<span>
    

    Some bullshit like this should work.

    None of these did anything except the color ones.

  • bowenbowen How you doin'? Registered User regular
    What kind of janked ass HTML are you working with?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
    Delmain
  • TofystedethTofystedeth Registered User regular
    Does it have to start as HTML? If the user never sees it could you write the postscript directly using something like ReportLab?

    steam_sig.png
  • urahonkyurahonky Registered User regular
    Whatever Chrome's using. I even did the inspect element and added it on there and nothing changed at all.

  • urahonkyurahonky Registered User regular
    edited July 2015
    I did find out that I can use JS to make this... Let's see how long it takes me. :P

    e: Son of a bitch. This has to be built on the fly.

    God FUCK reports. Fuck everything about this stupid bullshit.

    urahonky on
  • urahonkyurahonky Registered User regular
    Does it have to start as HTML? If the user never sees it could you write the postscript directly using something like ReportLab?

    I used this but it's a pain in the ass. Everything you place on the page has to have exact X and Y coordinates. If the user enters a string that is > 100 or something then it pushes the text down, but I won't know how draw it on the page.

  • bowenbowen How you doin'? Registered User regular
    edited July 2015
    http://jsfiddle.net/30u8q7vs/

    Should kind of give an example of what you can do with this. margin: 0 auto with text-align:center shoves things towards the middle.

    Moving things towards the middle tends to be problematic once you start factoring in different resolutions and shit like "this is a PDF".

    bowen on
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • TofystedethTofystedeth Registered User regular
    You using the open-source or the Plus version? The Plus version is supposed have more HTMLlike and text flowing capabilities.

    steam_sig.png
  • urahonkyurahonky Registered User regular
    You using the open-source or the Plus version? The Plus version is supposed have more HTMLlike and text flowing capabilities.

    Open source. I didn't realize they had a plus version.

  • bowenbowen How you doin'? Registered User regular
    Wait that jsfiddle link is wrong.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • bowenbowen How you doin'? Registered User regular
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • RendRend Registered User regular
    urahonky wrote: »
    bowen wrote: »
    urahonky wrote: »
    Holy shit. Creating a simple HTML page without javascript is painful as fuck.
    <html>
    <head>
        <title>Simple HTML Page W/O JavaScript</title>
    </head>
        <body>This is a simple HTML page without JavaScript.  It doesn't seem very painful.</body>
    </html>
    

    Bah, you know what I mean.

    Look at this: HOW AM I SUPPOSED TO CENTER THIS?!

    vOyIQLW.png

    Text is in a span. I have tried vertical-align, padding-top, margin-top... nothing has an effect.

    The answer is not to vertically center stuff in HTML. Use a padding instead. Vertical center isn't something HTML copes with very well at all. Horizontal center, sure. Vertical? Not so much.
    
    <div style="background-color:blue; padding:5px; color:white; font-weight: bold">
    	hello
    </div>
    
    

    bowenDisruptedCapitalist
  • bowenbowen How you doin'? Registered User regular
    Oh vertically center? lol you're never going to be able to do that very well.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
    Echo
  • RendRend Registered User regular
    You said you tried padding and it didn't work. Could you post a snippet? If padding isn't working, something's wrong.

    Echo
  • TofystedethTofystedeth Registered User regular
    edited July 2015
    urahonky wrote: »
    You using the open-source or the Plus version? The Plus version is supposed have more HTMLlike and text flowing capabilities.

    Open source. I didn't realize they had a plus version.

    The open source version also has access (I think) to their page layout library Platypus, (I'm not gonna do their stupid backronym capitalization) which looks like it lets you work more on a document/form level with flowables and stuff, though I've never used it. When I did anything with report lab I was taking existing text reports from an old Wang system which were well formatted already and just converting them to PDFs so they could be easily read and not printed out thousands of pages at a time, so I was able to get by with the basic textline stuff.

    Tofystedeth on
    steam_sig.png
  • urahonkyurahonky Registered User regular
    Okay what the hell?
    <span class='patient-info' style="align:center;vertical-align:center;display:block;width;500px;padding-top:5px;">&nbsp&nbsp&nbspPatient Information</span>
    

    Works fine, but if I put it inside my css it does not work. Why is that the case? In my CSS I changed it to sans-serif, and the font-size and those changes came through, but when I put padding-top: 5px; it didn't pull through or show up... But when I added it to the style there it worked fine.

  • bowenbowen How you doin'? Registered User regular
    Maybe your CSS class is not proper?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
    Rend
  • urahonkyurahonky Registered User regular
    And now it's working using CSS.

    Fuck HTML.

    DisruptedCapitalist
  • bowenbowen How you doin'? Registered User regular
    Caching issues maybe?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • urahonkyurahonky Registered User regular
    bowen wrote: »
    Maybe your CSS class is not proper?

    This actually might be a case of me being dumb and knowing very little CSS. I'm used to sass. If I have the class set to "patient-info" and it's a span. In my CSS I had span.patient-info... Was this wrong? I changed it to just '.patient-info' and that seemed to pull the right changes... But only some of them didn't work before.

This discussion has been closed.