Jump to content

Unable to get my Table code in custom.css working.


stacksos

Recommended Posts

I've been trying to use the custom.css area to perform the CSS tasks needed on my website. I am sure I am entering them in incorrectly. I only need a few tables on the website as I use WordPress for everything else outside of this website.

 

I can do CSS coding for an individual page, but using the custom.css I am not fully understanding it.

 

<style type="text/css">
td{text-align:center; font: rockwell}
tr{text-align:center; font: rockwell}
table, td, th { border: 1px solid gray }
#tst1 {table-layout: auto;
display: table;}
table {width: 90%;
margin: 20px;}
table.center {margin-left:auto; 
margin-right:auto;}
</style>

 

I would like this code for ALL my tables within my WHMCS website.

Link to comment
Share on other sites

Your syntax is off in that, for one thing. You're missing the ; at the end of several declarations.

What is it doing (or not) when it's used?

 

She works how I want it to work in Notepad++ just fine. Just trying to get the code right in the custom.css file is what is throwing me for a loop. Attached is how I want it to look. WordPress made me forget a lot, and I was still new to CSS when I started WordPress. Now I am trying to get back into CSS.

 

Right now pasting that in the custom.css file is giving me a blank page even when I have data in the file. I delete the code from custom.css and my data shows on the page. New to WHMCS layout and still a newbie in CSS is causing a major headache.

 

Thanks! I tried searching and couldn't find anything with my exact needs. I appreciate the help!

 

tablecss.png

Link to comment
Share on other sites

If you change your mind, it may be just those missing ";" from the style declarations.

If you want to give it another shot I'd be happy to have a look.

 

I never throw in the towel. I'd LOVE to use it in the WHMCS theme instead of just linking to a plain HTML page. I have the charts done now I can come back to problem-solving this. Needed to get the charts up so a client could compare them.

Link to comment
Share on other sites

I never throw in the towel. I'd LOVE to use it in the WHMCS theme instead of just linking to a plain HTML page.

Ok, then, see if this does what you need. Keep the table ID as #tst1 as in the example.

table#tst1 {

margin: 20px;

border: 1px solid gray;

width: 90%;

font-family: Rockwell, serif;

text-align: center;

margin-left:auto;

margin-right:auto;

}

table#tst1 tr td, table#tst1 tr th {

border: 1px solid gray;

width: 33%;

}

Link to comment
Share on other sites

Unfortunately, it did nothing. I was able to get it to put a border doing the following code.

 

.table, th, td {
  border: 1px solid black;
}

 

- - - Updated - - -

 

Wish it had an edit button. Hate making multiple posts.

 

I just need the table to center the text in each cell. Everything else I can do manually on each individual table.

Link to comment
Share on other sites

  • 2 weeks later...
Did nothing? In my test it replicated your table exactly when the table had an ID of #tst1.

How weird.

 

I've noticed a delay in the refreshing. Text is immediate, but when I do CSS I have to close the browser, resign in, etc. Then it is showing.

 

- - - Updated - - -

 

Wish CSS came to me like automotive and electrical. We wouldn't be having this issue. LOL

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated