Need Help with some HTML Code of a Star Wars: Edge of the Empire Campaign

IanHoulihan
IanHoulihan
edited August 2014 in Campaign Portal Building
OK, so I'm embarking on setting up a Star Wars: Edge of the Empire Campaign and I need to have a stats page. I have used a table (which I know is possibly a bad idea on Obsidian Portal). Here is the code:

bq). 222222

Would anyone like to make a recommendation on what I'm doing wrong here please.

As a side note, I removed all the spaces as they were moving the table down the page.
«13

Comments

  • IanHoulihan
    IanHoulihan
    Posts: 79 edited August 2014
    This is how it currently appears:

    "STAR WARS: EDGE OF THE EMPIRE TEST CHARACTER":https://edge-of-the-empire-veil-of-darkness.obsidianportal.com/characters/test-character
    Post edited by IanHoulihan on
  • ketherian
    ketherian
    Posts: 203
    Hi.

    What are you trying to get it to look like?
    -
    Ketherian
    "Signs & Portends":https://swtwc.obsidianportal.com/
  • IanHoulihan
    IanHoulihan
    Posts: 79 edited August 2014
    This the is an example of what I'd like it to look like (but with the attribute numbers in the circles).

    "STAR WARS: EDGE OF THE EMPIRE TEST CHARACTER 2":https://edge-of-the-empire-veil-of-darkness.obsidianportal.com/characters/test-character-2
    Post edited by IanHoulihan on
  • ketherian
    ketherian
    Posts: 203
    I'm getting the same as you when I try to plug in the code. I'm rather surprised the graphics are not showing up.
    Maybe it's the hard-links you have to your graphics.
    I can't reproduce this to test, but try replacing the tags with textile's [[File]] tags (using the Image button on the right-side of the page to select the image from your library).

    – Ketherian
    "Signs & Portends":https://swtwc.obsidianportal.com
  • Brandonshire
    Brandonshire
    Posts: 5
    I'm also very interested in this as my group is just starting up a Star Wars campaign ourselves.
  • IanHoulihan
    IanHoulihan
    Posts: 79
    The issues that I have are two fold:

    1) The images that are in the top section are background images, and I believe this is why it doesn't like it. But I am not experienced enough to fix it.

    2) The tables in OP appear to have too much padding, but in the code, I have quite clearly stated no padding.

    I wish I had more coding skill to see the problem :(
  • dawnhawk
    dawnhawk
    Posts: 113
    Ello...

    Ok so ignoring the fact that Tables used willy nilly are just bad in general at this point given how they mess up...well anything responsive. I've put this post into text because I didn't want to fiddle with the Textile commands right now (so you will have to copy the link in order to see the table).

    You have a couple of things going on. So I'm going to put the "tldr" first. Which is...the code. Make sure if you just copy this that it comes through with straight-quotes. Note - I have not fixed ALL of the issues with this. I've just made it look the way you say you want it to. Namely like this: https://dawnhawk-s-test.obsidianportal.com/characters/table-test






    2
    2
    2
    2
    2
    2






     
     
     
     
     
     






    The not tldr:
    Try to avoid using HTML commands for styling purposes. You are going to run into issues. If the CSS exists to do what you want, use the CSS. I've moved your table background and text-alignment into styling tags, which then renders as desired. It's still fixed width and going to look wonky as hell on a mobile device if that matters. Making tables responsive takes a bit more work and a lot more CSS.
  • IanHoulihan
    IanHoulihan
    Posts: 79 edited August 2014
    Thank you so much for that, although ultimately it may just be easier to do the stat block in a graphic and just run with straight text.

    For some reason your code didn't quite work, and the link you provided was closed to me :(

    Do I need to be doing anything with the CSS as well?
    Post edited by IanHoulihan on
  • dawnhawk
    dawnhawk
    Posts: 113
    Oh...sorry. I unlocked the test campaign. I usually leave it locked cause I'm generally in some random form of chaos on there. ^.^

    You should be able to see it now.

    I don't have anything in the campaign CSS except the "don't show the stupid break tags" line.
  • dawnhawk
    dawnhawk
    Posts: 113
    Which...means I don't have the standard padding removed the way you do. :)

    As a side note.
  • IanHoulihan
    IanHoulihan
    Posts: 79
    Hrrmmm...this is how the link you gave me and the code looks when entered on the page:

    "LINK":https://db4sgowjqfwig.cloudfront.net/campaigns/94329/assets/355570/tabletest.jpg?1407288329

    Weird. Suggestions?
  • dawnhawk
    dawnhawk
    Posts: 113
    Out of curiosity - what browser? Sorry, I was doing a quick fix so I only tested in Chrome.
  • IanHoulihan
    IanHoulihan
    Posts: 79
    I have tested it on Firefox (what I solely use) and IE. Both have the same results.
  • dawnhawk
    dawnhawk
    Posts: 113
    Ok - then your best bet is going to be to redo the table using entirely CSS, so you can make the allowances for Mozilla and IE.

    This is why I say don't use HTML commands for styling purposes.

    You know the line from Pirates of the Caribbean? "Well they are more like guidelines...."

    That's what HTML standards are. It's up to the browser if/when/how/what they will actually follow. CSS will give you more freedom to go "look if someone is using messed up browser A do this, if they are using messed up browser B do that, and if they are using messed up browser C, D or E...do something else entirely".

    I can maybe play around with the code a bit later and come up with CSS that will do what you want across "certain" browsers.

    Or you can start migrating it so that you just have a straight table, and all of the styling is in the campaign CSS properly, and play until it looks right for you and yours.

    Or, as you said try and line up a flat image with text. Which...will still potentially run into issues depending on browser and screen resolution.
  • dawnhawk
    dawnhawk
    Posts: 113 edited August 2014
    Oh - as a quick fix. Set the background-repeat:no-repeat on each cell.

    I've officially been looking at code too long today.

    Still working on the rest of the wonkiness.
    Post edited by dawnhawk on
  • dawnhawk
    dawnhawk
    Posts: 113 edited August 2014
    Ok...tell me if this looks right in your browsers, and then I'll show you the code. I tested in Chrome and IE11 (well and an emulator of Firefox 31.0...but I'm not sure I always trust Browserstack...).

    https://dawnhawk-s-test.obsidianportal.com/characters/css-table-test
    Post edited by dawnhawk on
  • IanHoulihan
    IanHoulihan
    Posts: 79
    That looks exactly as it should yes.
  • IanHoulihan
    IanHoulihan
    Posts: 79
    Well apart from the size of the numbers...but I can play with that.
  • IanHoulihan
    IanHoulihan
    Posts: 79 edited August 2014
    And how do you get it to ignore the page breaks so you don't just have this wad of text which looks like you've viewing the "matrix" directly?
    Post edited by IanHoulihan on
  • dawnhawk
    dawnhawk
    Posts: 113
    Yay!

    Alright.

    So first the HTML:




    2
    2
    2
    2
    2
    2















    A touch cleaner. :) NOTE: I left the Background URLs for the bottom row as inline styles - this is so you can change the image to the appropriate one for each attribute without having to make redundant classes in the CSS.


    Next...the CSS.

    .stat_table{
    border-style:none;
    border-collapse: collapse;
    width:50%;
    }

    .stat_table .stat_row{
    padding:0px;
    }

    .stat_table .stat_row .edge_cell_top{
    vertical-align:bottom;
    min-width:13px;
    padding:0;
    }

    .stat_table .stat_row .edge_cell_bottom{
    vertical-align:top;
    max-height:18px;
    padding:0;
    }

    .stat_table .stat_row .stat_cell{
    background:url(https://db4sgowjqfwig.cloudfront.net/campaigns/94329/assets/353932/eote-stats-main-top.jpg);
    background-repeat:no-repeat;
    text-align:center;
    font-family:Arial;
    font-size:2;
    font-face:bold;
    min-width:79px;
    }

    .stat_table .stat_row .att_cell{
    max-height:18px;
    text-align:center;
    background-repeat:no-repeat;
    }

    The big note here is that I've nested the classes to within an inch of their lives...that's so this table, this CSS, and these class names will ONLY affect tables when the classes are all used in conjunction. In case you accidentally replicate the class names later. Or copy and paste something you shouldn't. This means that if you get a table cell the class "att_cell" but you haven't given the row it's in or the table it's in the right classes - this CSS won't show up.

    (If I'm preaching to the choir here, forgive me. You said your code was rusty - and I've learned to never assume someone knows how my brain works.)
  • dawnhawk
    dawnhawk
    Posts: 113 edited August 2014
    br { display: none; }

    Careful with that...it will make it so no breaks show up. Anywhere.
    Post edited by dawnhawk on
  • IanHoulihan
    IanHoulihan
    Posts: 79
    Yeah might leave that one alone :)

    You sir are DA MAN!
  • IanHoulihan
    IanHoulihan
    Posts: 79
    Any suggestions of increasing the size of the numbers? I just don't want to add something and it go completely out of wack.
  • dawnhawk
    dawnhawk
    Posts: 113
    ...aw, can I be "da woman" instead? (I know I know...a female gamer AND programmer...on the internet...we don't exist).

    :P

    Your welcome!
  • dawnhawk
    dawnhawk
    Posts: 113
    font-size:X

    Where X is the number you want.

    5 might be good?
  • dawnhawk
    dawnhawk
    Posts: 113
    Oh sorry...be more specific:

    In here:
    .stat_table .stat_row .stat_cell{
    background:url(https://db4sgowjqfwig.cloudfront.net/campaigns/94329/assets/353932/eote-stats-main-top.jpg);
    background-repeat:no-repeat;
    text-align:center;
    font-family:Arial;
    font-size:2;
    font-face:bold;
    min-width:79px;
    }

    Change the 2 to...whatever.
  • IanHoulihan
    IanHoulihan
    Posts: 79
    I am so sorry. Totally a foot in mouth. You are awesome. I wish I had your skills.
  • dawnhawk
    dawnhawk
    Posts: 113
    Oh...ignore the size thing. Sigh.

    Change it to a px value. So 12px.
  • dawnhawk
    dawnhawk
    Posts: 113
    Did some mucking with it. It blows out funny if you go above 26px. So keep the font 26 and under and you should be fine. I have it set to 26px at the moment on the test link.
  • IanHoulihan
    IanHoulihan
    Posts: 79 edited August 2014
    Yep, it works well I found at 20, although it doesn't appear to be in bold - although the codes says it is.
    Post edited by IanHoulihan on
Sign In or Register to comment.

April 2024
Season of Strife

Read the feature post on the blog
Return to Obsidian Portal

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions