WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Links in table not formatted consistently (6 posts)

  1. bobbear43
    Member
    Posted 1 year ago #

    see http://www.botop.org/about-botop-bears/ for example

    links in table on that page have no underline. before i edited the html and formatted each table row code exactly the same, some had underlines, some did not. wp also sticks <p></p> pairs in my code in tables inconsistently. a table row does not need <p></p>.

    links within text on a page are underlined.

    since i can fix the table to look like i want it to look, the problem is more the inconsistencies of displaying links.

  2. Felix Renicks
    Member
    Posted 1 year ago #

    Links are not underlined in your side navigation because of the following entry in your theme's style.css file:

    a:link ,a:active ,a:visited {
    text-decoration: none;
    border: none;
    text-decoration: none;
    }

    Removing "text-decoration:none;" (both times) will enable underlines on all links. To enable underlined links for just the content area of your page, add this code to style.css:

    entry a {
    text-decoration: underline;
    }

  3. bobbear43
    Member
    Posted 1 year ago #

    As I said above, at first some links in the side navigation table had underlines and some did not. I had already learned that WP does some quirky stuff with tables. Some of the html had unneeded <p></p> pairs. I removed all those and made sure all cells were formatted the same, meaning that the html code was arranged the same in each. And then no rows had underlined links. Links in plain text elsewhere do have underlines, including in other tables. IMO, quirky behavior.

    I am a programmer (retired) on multiple platforms. I do not know enough yet about PHP, CSS and WordPress, but I expect consistent behavior. The intent of the code may be as stated, however something is over-riding it at times. Just like the ghost lines I get in some tables that are neither in the source when viewed in the editor, or in the html when viewing source of a page displayed in a browser.

  4. Chris Lema
    Member
    Posted 1 year ago #

    What you are seeing is not the result of your code (HTML or PHP). Instead, it's the result of CSS where the C stands for Cascading. What that means is that the definition of a style is based not only on the content that it is styling, nor just on the local context surrounding that style (<p></p>) but also on the larger context - particularly above it. Since every bit of code is embraced by larger containers, you may likely see <a> tags that are underlined when they're in the main content container and not see them underlined in your sidebar. That's because those are different containers and they scope the styles that apply.

    That's why Felix suggested that if you only wanted underlining for your entries, you would create a CSS rule for entry a { because that's the scope of the container that holds your articles (and side navigation). Now, if you want the underlining on your side navigation, but not the text of your articles, you'd have to add a style for that.

  5. Felix Renicks
    Member
    Posted 1 year ago #

    Your CSS stylesheet is set to only underline links inside <p> tags.

  6. bobbear43
    Member
    Posted 1 year ago #

    All the comments have added to my knowledge. Now I know what to expect. I actually don't need underlines in my navigation tables, but now I know how to get them there. One is not supposed to need to mess with html.... but.

    I still see a problem that sometimes WP brackets table cell data with <p></p> and sometimes it does not. When there is extensive text, it is consistent. In the case of my table containing page titles, it was not consistent until I created a table in a separate file that I could copy into each page that needed it, in source html.

    We are using a table in a table for navigation in one column and text in another as we will eventually need more than one sidebar. We are trying to avoid getting complicated.

    WP needs a "container" that means "don't mess with the code in this container."

Topic Closed

This topic has been closed to new replies.

About this Topic