[Resolved] Problem setting border and color to the HTML table

Home Forums Support [Resolved] Problem setting border and color to the HTML table

Home Forums Support Problem setting border and color to the HTML table

  • This topic has 14 replies, 3 voices, and was last updated 9 years ago by Tom.
Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #86575
    Siong Boon Lim

    Hi Tom,

    I am current facing some issue using the table features from the
    “TinyMCE Advanced” plugin on the following page
    http://www.pic-control.com/electronic-product-development/

    Cannot seems to align the table to the center.
    Cannot set the border to display.

    Wondering if GeneratePress allows setting up table?
    or is it some other problem that causes this.

    Thank you for your help.

    #86583
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    This article may help: http://roxeteer.com/table-border-css/

    Let me know ๐Ÿ™‚

    #90143
    Siong Boon Lim

    The default theme css is preventing me from setting the border.
    Using the code inspector, I can set it.
    Which means that I have to edit the css.

    Would appreciate advice in this. Am I doing it wrongly?

    #90328
    Tom
    Lead Developer
    Lead Developer

    If you add your custom CSS to your child theme or using another method (check the link in my signature below), it will overwrite the default table CSS with the CSS you want.

    #90612
    Siong Boon Lim

    Is there any other way without having to overwrite the default css in the generatepress? I just need the table to have border.

    #90687
    Tom
    Lead Developer
    Lead Developer

    Well, either way you’ll need to add your own CSS to give the table a border, because GeneratePress doesn’t do that by default.

    The overwriting of the core table CSS isn’t an extra time, and won’t even be noticeable.

    Once you add your custom CSS to include the border, it will just show up.

    Hope this helps ๐Ÿ™‚

    #90716
    Siong Boon Lim

    Hi Tom,

    I thought the setting of table border should be in the HTML?
    I still don’t see why it has to be done in the css?

    Would appreciate for your advise on this.
    Thank you.

    #90881
    Tom
    Lead Developer
    Lead Developer

    You could do it within the table itself – I just prefer using CSS as it will apply to all tables throughout your site, and is much cleaner than styling them individually.

    #91063
    walshmagger

    Hope this will help you…..HTML Border

    Walsh

    #92153
    Siong Boon Lim

    I have tried this

    <table class=”alignleft” style=”border-color: #115533;” border=”1″>

    and this

    <table border=”5″>

    The border does not show up.

    I do not need to style, because I only need the border line to show up.
    Some table I may not want the border.
    That was why I assume it should be simple to do it in HTML.
    No matter how I do it, the line don’t show up.

    Am I right to say the default css over-write the table border?
    The reason why it doesn’t show up.

    #92234
    Tom
    Lead Developer
    Lead Developer

    It shouldn’t – can you link me to the page where you’re trying this so I can see if there’s any CSS overwriting the border value in the table itself?

    #92380
    Siong Boon Lim

    The link is in my first post.
    I have re-post it again here,
    http://www.pic-control.com/electronic-product-development/

    I was able to make the border show up when I use the code inspector to edit one of the line in the css style.

    #92414
    Tom
    Lead Developer
    Lead Developer

    This may help:

    caption, th, td {
        border-color: inherit;
        border-style: solid;
        border-width: 1px;
    }
    #92425
    Siong Boon Lim

    Hi Tom,

    The css that you provided does allow the border to be drawn.
    The problem is through-out the site, all tables border starts to appear.

    Sometimes I am using table for alignment purpose and do not need the table to show its border.

    I used to do it in HTML, where if I need border for the table, I can just indicate it in the HTML codes. Seems that this is not possible in Generate Theme.

    #92881
    Tom
    Lead Developer
    Lead Developer

    Give the table a class, like this:

    <table class="show-table-border">

    Then change the CSS to this:

    .show-table-border caption, 
    .show-table-border th, 
    .show-table-border td {
        border-color: inherit;
        border-style: solid;
        border-width: 1px;
    }

    This will make it so you can choose which tables will show the border.

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.