You are viewing limited content. For full access, please sign in.

Question

Question

css and tables

asked on August 29, 2016 Show version history

How can I specify the ccs coding for only one table?  I have tried identify the table and I am having not luck.  below is the code I am using.  Can you please tell me how to specify the table.  It is id="q91" class="form-q label-left cf-table-block label-left"

table {
    border-width: 1px;
    border-spacing: 4px;
    border-style: groove;
    border-color: gray;
    border-collapse: separate;
    background-color: rgb(255, 255, 240);
}
table th {
    border-width: 2px;
    padding: 3px;
    border-style: inset;
    border-color: gray;
    background-color: rgb(255, 255, 240);
    -moz-border-radius: ;
}
table td {
    border-width: 2px;
    padding: 3px;
    border-style: inset;
    border-color: gray;
    background-color: rgb(255, 255, 240);
}
 

0 0

Replies

replied on August 29, 2016

Hi Beverly, instead of using merely "table" for your selectors, you can specify "#q91 table" etc., since the id of the table is "q91".

You could also assign to the table a CSS class in the "Advanced" tab in the form designer (cf. tablecss.png), e.g. "mytable". This would be useful if you had multiple tables (but not all of them!) to share the same formatting, and I recommend this as a better practice.

Then you could use selectors of the form ".<class-name> table", and so forth, as below:

.mytable table {
     /* formatting for the table */
 }
.mytable table th {
     /* formatting for table header elements */
 }
 .mytable table td {
     /* formatting for table cells */
 }

You can consult the CSS Selector reference at W3Schools for more advanced usage of other CSS selectors, too.

Hope this helps!

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.