Thread: TBODY bordering

    #1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    677
    Rep Power
    7

    TBODY bordering


    My simple task is to define a border and background color to the TBODY of my table. I haven't made any attempt at the coloring yet. I've tried a handful of things and even ran Google for a bit with no luck. Many people ask how to do this, but any answers that help them don't seem to work for me. Atm, my table has no true content, similar to below. Any help how to border JUST the TBODY?
    Code:
    <DIV id="DoA">
      <H3>Parts Damaged On Arrival</H3>
      <HR />
      Were their parts damaged on arrival? &nbsp;
      <DIV style="border: #E0E0E0 1px solid;display: inline-block;">
        &nbsp;<INPUT name="doa" type="radio" value="1" /> Yes&nbsp;
        &nbsp;<INPUT name="doa" type="radio" value="0" /> No&nbsp;
      </DIV>
      <BR />
      <TABLE>
        <THEAD>
          <TR>
            <TH>Part Number</TH>
            <TH>Description</TH>
            <TH>Serial Number</TH>
            <TH>Qty</TH>
          </TR>
        </THEAD>
        <TBODY>
          <TR>
            <TD>This</TD>
            <TD>part</TD>
            <TD>is a</TD>
            <TD>list</TD>
          </TR>
        </TBODY>
      </TABLE>
    </DIV>
    Sorry for the duplicate post in HTML. Wasn't sure best spot.
    He who knows not and knows not he knows not: he is a fool - shun him. He who knows not and knows he knows not: he is simple - teach him. He who knows and knows not he knows: he is asleep - wake him. He who knows and knows he knows: he is wise - follow him
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    876
    Rep Power
    275
    adding
    Code:
    style="display:inline-block;border:1px solid black;background:yellow;"
    to your TBODY tag seems to work for me.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    677
    Rep Power
    7
    Placing the line below does nothing for me. I am using IE9. Should this be a problem in this version? The script needs to support IE. That is all the company uses.

    Code:
    <TBODY style="display:inline-block;border: 1px solid #000000;">
    He who knows not and knows not he knows not: he is a fool - shun him. He who knows not and knows he knows not: he is simple - teach him. He who knows and knows not he knows: he is asleep - wake him. He who knows and knows he knows: he is wise - follow him
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    876
    Rep Power
    275
    ah, yes...it works in IE10, but, not below that.

    looks like it'll be Kravvitz to the rescue on this one.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Location
    Where the World Once Stood
    Posts
    11
    Rep Power
    0
    Originally Posted by Triple_Nothing
    Placing the line below does nothing for me. I am using IE9....
    Code:
    <TBODY style="display:inline-block;border: 1px solid #000000;">
    Afaik, ie9 tbody does not support border. Also, your property/value pairs should be separated by commas, not semi-colons.

    did you try placing a container (div, span) around the tbody and styling that with a border? I have no idea if it would work (and what it would do to the appearance) but it may be worth a shot.

    Else, it's a good excuse to get the corp to upgrade their browser
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    677
    Rep Power
    7
    No luck surrounding the TBODY tag. Upgrading is no option, n I doubt they even runnin IE9, prolly IE8.
    Also, your property/value pairs should be separated by commas, not semi-colons.
    Semi-colon is defining the end of each line in CSS.
    He who knows not and knows not he knows not: he is a fool - shun him. He who knows not and knows he knows not: he is simple - teach him. He who knows and knows not he knows: he is asleep - wake him. He who knows and knows he knows: he is wise - follow him
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Location
    Where the World Once Stood
    Posts
    11
    Rep Power
    0
    Originally Posted by Triple_Nothing
    No luck surrounding the TBODY tag.
    Only other thing I can think of is to place another table within the tbody and style that table (sloppy, but it may satisfy your requirements)
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    677
    Rep Power
    7
    Ya, otherwise, if no one else has anything in mind, I'll prolly just border the inner cells . Was hoping a one-shot approach, but yep. *shrugz*
    He who knows not and knows not he knows not: he is a fool - shun him. He who knows not and knows he knows not: he is simple - teach him. He who knows and knows not he knows: he is asleep - wake him. He who knows and knows he knows: he is wise - follow him
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    677
    Rep Power
    7
    Now this really puts something out there that makes zero sense. This first link has the 2 items I am running. HTML & CSS. A direct view of this via my site looks this way.

    HOWEVER... If you copy the content from there, and overwrite the content in the second link, and re-run it, it shows up AS I WANT. WTF?! Both screens are now identical via code, but not the output. :-(

    Clean Straight Input of Code

    Copy and paste to this one.

    And not only that, but H3 tags only process in the first one, n not the second...


    But best post out there to cover it all, eve if the coding ain't as intended, is:
    Stack Overflow - Add borders on <tbody>
    1st half is the way I wanted, but 2nd half made it happen.
    Last edited by Triple_Nothing; December 26th, 2013 at 01:20 PM.
    He who knows not and knows not he knows not: he is a fool - shun him. He who knows not and knows he knows not: he is simple - teach him. He who knows and knows not he knows: he is asleep - wake him. He who knows and knows he knows: he is wise - follow him

IMN logo majestic logo threadwatch logo seochat tools logo