View Single Post
Old 06-18-2021, 11:46 AM   #3
jonesyb
Enthusiast
jonesyb can do the Funky Gibbon.jonesyb can do the Funky Gibbon.jonesyb can do the Funky Gibbon.jonesyb can do the Funky Gibbon.jonesyb can do the Funky Gibbon.jonesyb can do the Funky Gibbon.jonesyb can do the Funky Gibbon.jonesyb can do the Funky Gibbon.jonesyb can do the Funky Gibbon.jonesyb can do the Funky Gibbon.jonesyb can do the Funky Gibbon.
 
Posts: 36
Karma: 82258
Join Date: May 2021
Device: kindle
Quote:
Originally Posted by Turtle91 View Post
That's almost exactly what I use. Although, I tighten up the css a little, but that is just technique, not at all required.

Code:
table { 
        max-width: 95%;
        border-collapse: collapse;
        margin: 1em auto;
    }
tbody  td {
        border: 1px solid black;
        padding: 5px;
        text-align:center
    }
tbody  td:first-child {
        text-align: right
    }
I usually format headers and footers differently than the body, so I use the "tbody td", "thead th", and "tfoot td" individually.

I have seen css using "id" tags to define something specific...especially if it is used with js, but I haven't figured out if there is a point to it just to say that it is a tag... (especially since the IDs need to be unique). eg. <table id="table">

...same concept as people using classes (<p class="para">, <blockquote class="block">, etc.). Just define the base tag, then use a class or ID for a specific deviation from the default.

If there IS a reason, I would be interested in knowing.

You will also hear that tables should only be used when you absolutely MUST... and anything larger than 2-3 columns should be re-thought as it really messes up the display on smaller screen sizes; large tables usually do better as an image.
Thanks this is great! Looks like my tables aren't too far off then which is good to know.

Yes I have already made some tables in to images before that definitely would not be possible in an eBook. I also try to avoid them where possible.
jonesyb is offline   Reply With Quote